From 81b9fc9d92bb74aa8428ae4db39bd84e8c16095c Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 20 Jun 2026 18:34:54 +0900 Subject: refactor(php-shim): drop Box wrapping from PhpMixed List/Array The List and Array variants of PhpMixed boxed their elements unnecessarily. Store PhpMixed values directly and update all callers accordingly. Co-Authored-By: Claude Opus 4.8 (1M context) --- crates/shirabe/src/repository/platform_repository.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'crates/shirabe/src/repository/platform_repository.rs') diff --git a/crates/shirabe/src/repository/platform_repository.rs b/crates/shirabe/src/repository/platform_repository.rs index f345eaa..e006d19 100644 --- a/crates/shirabe/src/repository/platform_repository.rs +++ b/crates/shirabe/src/repository/platform_repository.rs @@ -325,7 +325,7 @@ impl PlatformRepository { loaded_extensions .iter() .enumerate() - .map(|(i, s)| (i.to_string(), Box::new(PhpMixed::String(s.clone())))) + .map(|(i, s)| (i.to_string(), PhpMixed::String(s.clone()))) .collect(), ), true, @@ -824,13 +824,13 @@ impl PlatformRepository { Box::new(|_args| PhpMixed::Null), vec![ PhpMixed::List(vec![ - Box::new(PhpMixed::String("ResourceBundle".to_string())), - Box::new(PhpMixed::String("create".to_string())), + PhpMixed::String("ResourceBundle".to_string()), + PhpMixed::String("create".to_string()), ]), PhpMixed::List(vec![ - Box::new(PhpMixed::String("root".to_string())), - Box::new(PhpMixed::String("ICUDATA".to_string())), - Box::new(PhpMixed::Bool(false)), + PhpMixed::String("root".to_string()), + PhpMixed::String("ICUDATA".to_string()), + PhpMixed::Bool(false), ]), ], ); @@ -857,8 +857,8 @@ impl PlatformRepository { let intl_char_versions = self.runtime.invoke( Box::new(|_args| PhpMixed::Null), vec![PhpMixed::List(vec![ - Box::new(PhpMixed::String("IntlChar".to_string())), - Box::new(PhpMixed::String("getUnicodeVersion".to_string())), + PhpMixed::String("IntlChar".to_string()), + PhpMixed::String("getUnicodeVersion".to_string()), ])], ); let sliced = @@ -1840,7 +1840,7 @@ impl PlatformRepository { match value { PhpMixed::List(list) => list .iter() - .map(|v| match v.as_ref() { + .map(|v| match v { PhpMixed::String(s) => s.clone(), PhpMixed::Int(i) => i.to_string(), PhpMixed::Float(f) => f.to_string(), @@ -1849,7 +1849,7 @@ impl PlatformRepository { .collect(), PhpMixed::Array(m) => m .values() - .map(|v| match v.as_ref() { + .map(|v| match v { PhpMixed::String(s) => s.clone(), PhpMixed::Int(i) => i.to_string(), PhpMixed::Float(f) => f.to_string(), -- cgit v1.3.1