diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-20 18:34:54 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-20 18:34:54 +0900 |
| commit | 81b9fc9d92bb74aa8428ae4db39bd84e8c16095c (patch) | |
| tree | 3efb6476d797e2a95545c4c3abba468c3e3c8d52 /crates/shirabe/src/installer | |
| parent | c09cd630afb4bb0ca10e926f93bf706ca828ae85 (diff) | |
| download | php-shirabe-81b9fc9d92bb74aa8428ae4db39bd84e8c16095c.tar.gz php-shirabe-81b9fc9d92bb74aa8428ae4db39bd84e8c16095c.tar.zst php-shirabe-81b9fc9d92bb74aa8428ae4db39bd84e8c16095c.zip | |
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) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/installer')
| -rw-r--r-- | crates/shirabe/src/installer/installation_manager.rs | 30 |
1 files changed, 9 insertions, 21 deletions
diff --git a/crates/shirabe/src/installer/installation_manager.rs b/crates/shirabe/src/installer/installation_manager.rs index 4d813a5..e149b41 100644 --- a/crates/shirabe/src/installer/installation_manager.rs +++ b/crates/shirabe/src/installer/installation_manager.rs @@ -659,9 +659,9 @@ impl InstallationManager { http.insert("method".to_string(), PhpMixed::String("POST".to_string())); http.insert( "header".to_string(), - PhpMixed::List(vec![Box::new(PhpMixed::String( + PhpMixed::List(vec![PhpMixed::String( "Content-type: application/x-www-form-urlencoded".to_string(), - ))]), + )]), ); let params_vec: Vec<(&str, &str)> = params .iter() @@ -674,9 +674,7 @@ impl InstallationManager { http.insert("timeout".to_string(), PhpMixed::Int(3)); opts.insert( "http".to_string(), - PhpMixed::Array( - http.into_iter().map(|(k, v)| (k, Box::new(v))).collect(), - ), + PhpMixed::Array(http.into_iter().collect()), ); tokio::runtime::Runtime::new().unwrap().block_on( @@ -714,12 +712,7 @@ impl InstallationManager { } } if let Some(PhpMixed::List(downloads)) = post_data.get_mut("downloads") { - downloads.push(Box::new(PhpMixed::Array( - package_notification - .into_iter() - .map(|(k, v)| (k, Box::new(v))) - .collect(), - ))); + downloads.push(PhpMixed::Array(package_notification.into_iter().collect())); } } @@ -729,26 +722,21 @@ impl InstallationManager { http.insert("method".to_string(), PhpMixed::String("POST".to_string())); http.insert( "header".to_string(), - PhpMixed::List(vec![Box::new(PhpMixed::String( + PhpMixed::List(vec![PhpMixed::String( "Content-Type: application/json".to_string(), - ))]), + )]), ); http.insert( "content".to_string(), PhpMixed::String( - json_encode(&PhpMixed::Array( - post_data - .into_iter() - .map(|(k, v)| (k, Box::new(v))) - .collect(), - )) - .unwrap_or_default(), + json_encode(&PhpMixed::Array(post_data.into_iter().collect())) + .unwrap_or_default(), ), ); http.insert("timeout".to_string(), PhpMixed::Int(6)); opts.insert( "http".to_string(), - PhpMixed::Array(http.into_iter().map(|(k, v)| (k, Box::new(v))).collect()), + PhpMixed::Array(http.into_iter().collect()), ); tokio::runtime::Runtime::new().unwrap().block_on( |
