From d1dc87807ea3eb8d35d916b156cd9f3397b48b7c Mon Sep 17 00:00:00 2001 From: Vasiliy Stelmachenok Date: Sat, 28 Mar 2026 12:37:30 +0300 Subject: [PATCH] core: Make clippy happy Signed-off-by: Vasiliy Stelmachenok --- src/main.rs | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/main.rs b/src/main.rs index adf2c65..937bf02 100644 --- a/src/main.rs +++ b/src/main.rs @@ -123,21 +123,22 @@ fn main() -> anyhow::Result<()> { anyhow::bail!("Error occurred"); } } else if argstruct.remove.is_some() { - let working_profile = get_installed_profile(&data_obj, profile_name); - if working_profile.is_none() { + if let Some(working_profile) = &get_installed_profile(&data_obj, profile_name) { + if !perform_transaction( + &mut data_obj, + &argstruct, + working_profile, + Transaction::Remove, + argstruct.force, + ) { + anyhow::bail!("Error occurred"); + } + } else { console_writer::print_error_msg!( "profile-not-installed", profile_name = profile_name ); anyhow::bail!("Error occurred"); - } else if !perform_transaction( - &mut data_obj, - &argstruct, - working_profile.as_ref().unwrap(), - Transaction::Remove, - argstruct.force, - ) { - anyhow::bail!("Error occurred"); } } }