aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/downloader
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-06-20 00:31:45 +0900
committernsfisis <nsfisis@gmail.com>2026-06-20 00:31:49 +0900
commitcac18ef73a39b4ac41fa4d6ccb753804d4c42cb7 (patch)
tree968f438437042e8092752aa521c2d7e6ae28307e /crates/shirabe/src/downloader
parent7c5162e7c2f9d466e96248b7482aa98350244e8b (diff)
downloadphp-shirabe-cac18ef73a39b4ac41fa4d6ccb753804d4c42cb7.tar.gz
php-shirabe-cac18ef73a39b4ac41fa4d6ccb753804d4c42cb7.tar.zst
php-shirabe-cac18ef73a39b4ac41fa4d6ccb753804d4c42cb7.zip
feat(php-shim): implement count()
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/downloader')
-rw-r--r--crates/shirabe/src/downloader/vcs_downloader.rs35
1 files changed, 5 insertions, 30 deletions
diff --git a/crates/shirabe/src/downloader/vcs_downloader.rs b/crates/shirabe/src/downloader/vcs_downloader.rs
index a967c3b..18a50da 100644
--- a/crates/shirabe/src/downloader/vcs_downloader.rs
+++ b/crates/shirabe/src/downloader/vcs_downloader.rs
@@ -165,24 +165,14 @@ pub trait VcsDownloader:
true,
io_interface::NORMAL,
);
- } else if count(&PhpMixed::List(
- urls.iter()
- .map(|s| Box::new(PhpMixed::String(s.clone())))
- .collect(),
- )) > 0
- {
+ } else if urls.len() > 0 {
self.io().write_error3(
" Failed, trying the next URL",
true,
io_interface::NORMAL,
);
}
- if count(&PhpMixed::List(
- urls.iter()
- .map(|s| Box::new(PhpMixed::String(s.clone())))
- .collect(),
- )) == 0
- {
+ if urls.len() == 0 {
return Err(e);
}
}
@@ -279,24 +269,14 @@ pub trait VcsDownloader:
true,
io_interface::NORMAL,
);
- } else if count(&PhpMixed::List(
- urls.iter()
- .map(|s| Box::new(PhpMixed::String(s.clone())))
- .collect(),
- )) > 0
- {
+ } else if urls.len() > 0 {
self.io().write_error3(
" Failed, trying the next URL",
true,
io_interface::NORMAL,
);
}
- if count(&PhpMixed::List(
- urls.iter()
- .map(|s| Box::new(PhpMixed::String(s.clone())))
- .collect(),
- )) == 0
- {
+ if urls.len() == 0 {
return Err(e);
}
}
@@ -358,12 +338,7 @@ pub trait VcsDownloader:
true,
io_interface::NORMAL,
);
- } else if count(&PhpMixed::List(
- urls.iter()
- .map(|s| Box::new(PhpMixed::String(s.clone())))
- .collect(),
- )) > 0
- {
+ } else if urls.len() > 0 {
self.io().write_error3(
" Failed, trying the next URL",
true,