From efec43b3b8827820cf35fe1b73d8e33f5fe84eb4 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 20 Jun 2026 01:16:50 +0900 Subject: refactor: auto-fix clippy warnings --- crates/shirabe/src/command/reinstall_command.rs | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'crates/shirabe/src/command/reinstall_command.rs') diff --git a/crates/shirabe/src/command/reinstall_command.rs b/crates/shirabe/src/command/reinstall_command.rs index c7b6cc0..8f48243 100644 --- a/crates/shirabe/src/command/reinstall_command.rs +++ b/crates/shirabe/src/command/reinstall_command.rs @@ -39,6 +39,12 @@ pub struct ReinstallCommand { base_command_data: BaseCommandData, } +impl Default for ReinstallCommand { + fn default() -> Self { + Self::new() + } +} + impl ReinstallCommand { pub fn new() -> Self { let mut command = ReinstallCommand { @@ -171,11 +177,10 @@ impl Command for ReinstallCommand { let present_packages = local_repo.get_packages()?; let result_packages: Vec = - present_packages.iter().map(|p| p.clone().into()).collect(); + present_packages.to_vec(); let present_packages: Vec = present_packages .into_iter() .filter(|package| !package_names_to_reinstall.contains(&package.get_name())) - .map(|p| p.into()) .collect(); let transaction = Transaction::new(present_packages, result_packages); @@ -183,10 +188,10 @@ impl Command for ReinstallCommand { let mut install_order = indexmap::IndexMap::new(); for (index, op) in install_operations.iter().enumerate() { - if let Some(install_op) = op.as_any().downcast_ref::() { - if install_op.get_package().as_alias().is_none() { - install_order.insert(install_op.get_package().get_name(), index); - } + if let Some(install_op) = op.as_any().downcast_ref::() + && install_op.get_package().as_alias().is_none() + { + install_order.insert(install_op.get_package().get_name(), index); } } @@ -212,7 +217,7 @@ impl Command for ReinstallCommand { let config = composer.get_config(); let (prefer_source, prefer_dist) = - self.get_preferred_install_options(&*config.borrow(), input.clone(), false)?; + self.get_preferred_install_options(&config.borrow(), input.clone(), false)?; let installation_manager = composer.get_installation_manager().clone(); let download_manager = composer.get_download_manager(); -- cgit v1.3.1