aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/downloader/file_downloader.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-08-06 06:25:10 +0900
committernsfisis <nsfisis@gmail.com>2026-08-06 06:25:30 +0900
commit791ef1cd465597ff43dab4216c4b00e9e4160da8 (patch)
treeec6c3bc45f81576146325350faa6dcea638987b4 /crates/shirabe/src/downloader/file_downloader.rs
parenta86bbd67954f7bbc38bb09138edb335d82666526 (diff)
downloadphp-shirabe-791ef1cd465597ff43dab4216c4b00e9e4160da8.tar.gz
php-shirabe-791ef1cd465597ff43dab4216c4b00e9e4160da8.tar.zst
php-shirabe-791ef1cd465597ff43dab4216c4b00e9e4160da8.zip
refactor(php-shim): split in_array into strict and loose variants
Diffstat (limited to 'crates/shirabe/src/downloader/file_downloader.rs')
-rw-r--r--crates/shirabe/src/downloader/file_downloader.rs13
1 files changed, 6 insertions, 7 deletions
diff --git a/crates/shirabe/src/downloader/file_downloader.rs b/crates/shirabe/src/downloader/file_downloader.rs
index 48925b4b..c6ee3a20 100644
--- a/crates/shirabe/src/downloader/file_downloader.rs
+++ b/crates/shirabe/src/downloader/file_downloader.rs
@@ -28,8 +28,8 @@ use indexmap::IndexMap;
use shirabe_php_shim::{
DIRECTORY_SEPARATOR, InvalidArgumentException, PATHINFO_BASENAME, PATHINFO_EXTENSION,
PHP_URL_PATH, PhpMixed, RuntimeException, UnexpectedValueException, array_search, file_exists,
- filesize, get_class, hash, hash_file, in_array, is_dir, is_executable, parse_url, pathinfo,
- realpath, rtrim, spl_object_hash, strlen, strpos, strtr, trim, umask, usleep,
+ filesize, get_class, hash, hash_file, in_array_strict, is_dir, is_executable, parse_url,
+ pathinfo, realpath, rtrim, spl_object_hash, strlen, strpos, strtr, trim, umask, usleep,
};
use std::sync::{LazyLock, Mutex};
@@ -339,15 +339,14 @@ impl DownloaderInterface for FileDownloader {
if let Some(te) = e.downcast_ref::<TransportException>() {
// if we got an http response with a proper code, then requesting again will probably not help, abort
if 0 != te.get_code()
- && !in_array(
- PhpMixed::Int(te.get_code()),
- &PhpMixed::List(vec![
+ && !in_array_strict(
+ te.get_code(),
+ &[
PhpMixed::Int(500),
PhpMixed::Int(502),
PhpMixed::Int(503),
PhpMixed::Int(504),
- ]),
- true,
+ ],
)
{
retries = 0;