diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-20 01:16:50 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-20 02:22:41 +0900 |
| commit | efec43b3b8827820cf35fe1b73d8e33f5fe84eb4 (patch) | |
| tree | a62bbba72324de48be5f8e689559f8d9e288fc61 /crates/shirabe/src/command/require_command.rs | |
| parent | cac18ef73a39b4ac41fa4d6ccb753804d4c42cb7 (diff) | |
| download | php-shirabe-efec43b3b8827820cf35fe1b73d8e33f5fe84eb4.tar.gz php-shirabe-efec43b3b8827820cf35fe1b73d8e33f5fe84eb4.tar.zst php-shirabe-efec43b3b8827820cf35fe1b73d8e33f5fe84eb4.zip | |
refactor: auto-fix clippy warnings
Diffstat (limited to 'crates/shirabe/src/command/require_command.rs')
| -rw-r--r-- | crates/shirabe/src/command/require_command.rs | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/crates/shirabe/src/command/require_command.rs b/crates/shirabe/src/command/require_command.rs index a82f858..31d345a 100644 --- a/crates/shirabe/src/command/require_command.rs +++ b/crates/shirabe/src/command/require_command.rs @@ -67,6 +67,12 @@ pub struct RequireCommand { dependency_resolution_completed: bool, } +impl Default for RequireCommand { + fn default() -> Self { + Self::new() + } +} + impl RequireCommand { pub fn new() -> Self { let mut command = RequireCommand { @@ -394,7 +400,6 @@ impl Command for RequireCommand { .get_repos() .find_packages(name, None)? .into_iter() - .map(|p| p.into()) .collect(); let pkg: Option<crate::package::PackageInterfaceHandle> = PackageSorter::get_most_current_version(found_packages); @@ -537,9 +542,7 @@ impl Command for RequireCommand { } input.borrow_mut().set_option("dev", PhpMixed::Bool(true))?; - let swap = require_key; - require_key = remove_key; - remove_key = swap; + std::mem::swap(&mut require_key, &mut remove_key); } } } @@ -980,7 +983,7 @@ impl RequireCommand { let mut install = Installer::create(io.clone(), &composer_handle); let (prefer_source, prefer_dist) = self.get_preferred_install_options( - &*composer.get_config().borrow(), + &composer.get_config().borrow(), input.clone(), false, )?; @@ -1034,7 +1037,7 @@ impl RequireCommand { .unwrap_or(false), ) .set_audit_config( - self.create_audit_config(&mut *composer.get_config().borrow_mut(), input.clone())?, + self.create_audit_config(&mut composer.get_config().borrow_mut(), input.clone())?, ) .set_minimal_update(minimal_changes); |
