From d9dca94603766712b5989ea8169c9e286d27a60c Mon Sep 17 00:00:00 2001 From: nsfisis Date: Thu, 6 Aug 2026 10:37:12 +0900 Subject: refactor(php-shim): take &str and return String from pathinfo pathinfo only ever receives a string and only ever returns one for the single-component options it supports, so the PhpMixed wrapping forced every call site to pack and unpack the value again. Co-Authored-By: Claude Opus 5 (1M context) --- crates/shirabe/src/downloader/file_downloader.rs | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'crates/shirabe/src/downloader/file_downloader.rs') diff --git a/crates/shirabe/src/downloader/file_downloader.rs b/crates/shirabe/src/downloader/file_downloader.rs index c5dfc5f7..4ee580f8 100644 --- a/crates/shirabe/src/downloader/file_downloader.rs +++ b/crates/shirabe/src/downloader/file_downloader.rs @@ -712,20 +712,14 @@ impl FileDownloader { impl FileDownloader { fn get_dist_path(&self, package: PackageInterfaceHandle, component: i64) -> String { pathinfo( - PhpMixed::String( - parse_url( - &strtr(&package.get_dist_url().unwrap_or_default(), "\\", "/"), - PHP_URL_PATH, - ) - .as_string() - .unwrap_or("") - .to_string(), - ), + parse_url( + &strtr(&package.get_dist_url().unwrap_or_default(), "\\", "/"), + PHP_URL_PATH, + ) + .as_string() + .unwrap_or(""), component, ) - .as_string() - .unwrap_or("") - .to_string() } pub(crate) fn clear_last_cache_write(&self, package: PackageInterfaceHandle) { -- cgit v1.3.1