aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/plugin
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-07-25 16:16:33 +0900
committernsfisis <nsfisis@gmail.com>2026-07-25 16:17:10 +0900
commit432472808051cb4f1bb9517b858dbc810aaa5a63 (patch)
tree4c58b97942853ea2c3f58368203fa93187746cf8 /crates/shirabe/src/plugin
parentd4608662f28b9a5135986b1702afe3199957eabe (diff)
downloadphp-shirabe-432472808051cb4f1bb9517b858dbc810aaa5a63.tar.gz
php-shirabe-432472808051cb4f1bb9517b858dbc810aaa5a63.tar.zst
php-shirabe-432472808051cb4f1bb9517b858dbc810aaa5a63.zip
refactor: replace redundant clones with moves
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/plugin')
-rw-r--r--crates/shirabe/src/plugin/plugin_manager.rs13
1 files changed, 4 insertions, 9 deletions
diff --git a/crates/shirabe/src/plugin/plugin_manager.rs b/crates/shirabe/src/plugin/plugin_manager.rs
index aa3f0a7d..07b4438a 100644
--- a/crates/shirabe/src/plugin/plugin_manager.rs
+++ b/crates/shirabe/src/plugin/plugin_manager.rs
@@ -66,8 +66,7 @@ impl PluginManager {
.borrow()
.get_config()
.borrow()
- .get("allow-plugins")
- .clone();
+ .get("allow-plugins");
let locker = composer_rc.borrow().get_locker().clone();
let mut locker = locker.borrow_mut();
let allow_plugin_rules =
@@ -81,7 +80,6 @@ impl PluginManager {
.get_config()
.borrow_mut()
.get("allow-plugins")
- .clone()
})
.unwrap_or(PhpMixed::Bool(false)),
None,
@@ -232,8 +230,7 @@ impl PluginManager {
let current_plugin_api_constraint = SimpleConstraint::new(
"==".to_string(),
self.version_parser
- .normalize(&current_plugin_api_version, None)?
- .to_string(),
+ .normalize(&current_plugin_api_version, None)?,
None,
);
@@ -859,8 +856,7 @@ impl PluginManager {
.upgrade()
.expect("PluginManager must not outlive Composer")
.borrow()
- .get_config()
- .clone();
+ .get_config();
self.io.write_error(&format!("<warning>{}{} contains a Composer plugin which is currently not in your allow-plugins config. See https://getcomposer.org/allow-plugins</warning>",
package,
@@ -893,8 +889,7 @@ impl PluginManager {
// persist answer in composer.json if it wasn't simply discarded
if answer_str == "y" || answer_str == "n" {
- let allow_plugins_value =
- config.borrow_mut().get("allow-plugins").clone();
+ let allow_plugins_value = config.borrow_mut().get("allow-plugins");
if let Some(arr) = allow_plugins_value.as_array() {
let mut allow_plugins = arr.clone();
allow_plugins.insert(package.to_string(), PhpMixed::Bool(allow));