From 791ef1cd465597ff43dab4216c4b00e9e4160da8 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Thu, 6 Aug 2026 06:25:10 +0900 Subject: refactor(php-shim): split in_array into strict and loose variants --- crates/shirabe/src/repository/vcs_repository.rs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'crates/shirabe/src/repository/vcs_repository.rs') diff --git a/crates/shirabe/src/repository/vcs_repository.rs b/crates/shirabe/src/repository/vcs_repository.rs index 059d4dbd..c8790f81 100644 --- a/crates/shirabe/src/repository/vcs_repository.rs +++ b/crates/shirabe/src/repository/vcs_repository.rs @@ -29,7 +29,7 @@ use crate::util::Url; use indexmap::IndexMap; use shirabe_external_packages::composer::pcre::Preg; use shirabe_php_shim::{ - InvalidArgumentException, PhpClass, PhpMixed, in_array, php_regex, str_replace, strpos, + InvalidArgumentException, PhpClass, PhpMixed, in_array_strict, php_regex, str_replace, strpos, }; use shirabe_semver::constraint::SimpleConstraint; @@ -1030,14 +1030,9 @@ impl VcsRepository { } fn should_rethrow_transport_exception(&self, e: &TransportException) -> bool { - in_array( - PhpMixed::Int(e.get_code()), - &PhpMixed::List(vec![ - PhpMixed::Int(401), - PhpMixed::Int(403), - PhpMixed::Int(429), - ]), - true, + in_array_strict( + e.get_code(), + &[PhpMixed::Int(401), PhpMixed::Int(403), PhpMixed::Int(429)], ) || e.get_code() >= 500 } } -- cgit v1.3.1