From cac18ef73a39b4ac41fa4d6ccb753804d4c42cb7 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 20 Jun 2026 00:31:45 +0900 Subject: feat(php-shim): implement count() Co-Authored-By: Claude Opus 4.8 (1M context) --- crates/shirabe/src/downloader/vcs_downloader.rs | 35 ++++--------------------- 1 file changed, 5 insertions(+), 30 deletions(-) (limited to 'crates/shirabe/src/downloader') 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, -- cgit v1.3.1