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/gzip_downloader.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'crates/shirabe/src/downloader/gzip_downloader.rs') diff --git a/crates/shirabe/src/downloader/gzip_downloader.rs b/crates/shirabe/src/downloader/gzip_downloader.rs index 70b9f7bb..297cbc11 100644 --- a/crates/shirabe/src/downloader/gzip_downloader.rs +++ b/crates/shirabe/src/downloader/gzip_downloader.rs @@ -84,15 +84,12 @@ impl ArchiveDownloader for GzipDownloader { parse_url( &strtr(&package.get_dist_url().unwrap_or_default(), "\\", "/"), PHP_URL_PATH, - ), + ) + .as_string() + .unwrap_or(""), PATHINFO_FILENAME, ); - let target_filepath = format!( - "{}{}{}", - path, - DIRECTORY_SEPARATOR, - filename.as_string().unwrap_or_default() - ); + let target_filepath = format!("{}{}{}", path, DIRECTORY_SEPARATOR, filename); if !Platform::is_windows() { let command = vec![ -- cgit v1.3.1