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/plugin/plugin_manager.rs | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'crates/shirabe/src/plugin/plugin_manager.rs') diff --git a/crates/shirabe/src/plugin/plugin_manager.rs b/crates/shirabe/src/plugin/plugin_manager.rs index da64cee..3d9c461 100644 --- a/crates/shirabe/src/plugin/plugin_manager.rs +++ b/crates/shirabe/src/plugin/plugin_manager.rs @@ -900,8 +900,7 @@ impl PluginManager { config.borrow_mut().get("allow-plugins").clone(); if let Some(arr) = allow_plugins_value.as_array() { let mut allow_plugins = arr.clone(); - allow_plugins - .insert(package.to_string(), Box::new(PhpMixed::Bool(allow))); + allow_plugins.insert(package.to_string(), PhpMixed::Bool(allow)); if config .borrow_mut() .get("sort-packages") @@ -917,20 +916,16 @@ impl PluginManager { "allow-plugins", PhpMixed::Array(allow_plugins.clone()), )?; - let mut inner: IndexMap> = IndexMap::new(); + let mut inner = IndexMap::new(); inner.insert( "allow-plugins".to_string(), - Box::new(PhpMixed::Array(allow_plugins)), + PhpMixed::Array(allow_plugins), ); - let mut config_section: IndexMap> = - IndexMap::new(); - config_section - .insert("config".to_string(), Box::new(PhpMixed::Array(inner))); - let wrap: IndexMap = - config_section.into_iter().map(|(k, v)| (k, *v)).collect(); + let mut config_section = IndexMap::new(); + config_section.insert("config".to_string(), PhpMixed::Array(inner)); config .borrow_mut() - .merge(&wrap, crate::config::Config::SOURCE_UNKNOWN); + .merge(&config_section, crate::config::Config::SOURCE_UNKNOWN); } } -- cgit v1.3.1