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/factory.rs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'crates/shirabe/src/factory.rs') diff --git a/crates/shirabe/src/factory.rs b/crates/shirabe/src/factory.rs index de632143..7328bf42 100644 --- a/crates/shirabe/src/factory.rs +++ b/crates/shirabe/src/factory.rs @@ -375,15 +375,8 @@ impl Factory { } pub fn get_lock_file(composer_file: &str) -> String { - let ext = pathinfo( - PhpMixed::String(composer_file.to_string()), - PATHINFO_EXTENSION, - ); - let is_json = match ext { - PhpMixed::String(s) => s == "json", - _ => false, - }; - if is_json { + let ext = pathinfo(composer_file, PATHINFO_EXTENSION); + if ext == "json" { format!( "{}lock", substr(composer_file, 0, Some(composer_file.len() as i64 - 4)) -- cgit v1.3.1