From f5e070cdf6628a5ebd981d373929802317104e24 Mon Sep 17 00:00:00 2001 From: fxqnlr Date: Wed, 4 Sep 2024 09:56:42 +0200 Subject: clippy --fix --- src/commands/list.rs | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'src/commands/list.rs') diff --git a/src/commands/list.rs b/src/commands/list.rs index 3665446..63105cf 100644 --- a/src/commands/list.rs +++ b/src/commands/list.rs @@ -32,32 +32,32 @@ pub fn list_add( ) -> MLE<()> { let p = ProgressBar::new_spinner(); p.set_style(ProgressStyle::with_template(STYLE_OPERATION).unwrap()); - p.set_message(format!("Create {}", id)); + p.set_message(format!("Create {id}")); lists_insert(config, id, mc_version, modloader, directory)?; - p.finish_with_message(format!("Created {}", id)); + p.finish_with_message(format!("Created {id}")); Ok(()) } pub fn list_change(config: &Cfg, id: &str) -> MLE<()> { let p = ProgressBar::new_spinner(); p.set_style(ProgressStyle::with_template(STYLE_OPERATION).unwrap()); - p.set_message(format!("Change default list to {}", id)); + p.set_message(format!("Change default list to {id}")); if !lists_get_all_ids(config)?.into_iter().any(|l| l == id) { return Err(MLError::new(ErrorType::ArgumentError, "List not found")); }; config_change_current_list(config, id)?; - p.finish_with_message(format!("Changed default list to {}", id)); + p.finish_with_message(format!("Changed default list to {id}")); Ok(()) } pub fn list_remove(config: &Cfg, id: &str) -> MLE<()> { let p = ProgressBar::new_spinner(); p.set_style(ProgressStyle::with_template(STYLE_OPERATION).unwrap()); - p.set_message(format!("Remove {}", id)); + p.set_message(format!("Remove {id}")); lists_remove(config, id)?; - p.finish_with_message(format!("Removed {}", id)); + p.finish_with_message(format!("Removed {id}")); Ok(()) } @@ -77,15 +77,13 @@ pub async fn list_version( let p = ProgressBar::new_spinner(); p.set_style(ProgressStyle::with_template(STYLE_OPERATION).unwrap()); p.set_message(format!( - "Change version for list {} to minecraft version: {}", - id, mc_version + "Change version for list {id} to minecraft version: {mc_version}" )); lists_version(config, id, &mc_version)?; p.finish_with_message(format!( - "Changed version for list {} to minecraft version: {}", - id, mc_version + "Changed version for list {id} to minecraft version: {mc_version}" )); let list = lists_get(config, id)?; @@ -96,7 +94,7 @@ pub fn list_list(config: &Cfg) -> MLE<()> { let lists = lists_get_all_ids(config)?; for list in lists { let l = lists_get(config, &list)?; - println!("{}: | {} | {}", l.id, l.mc_version, l.modloader) + println!("{}: | {} | {}", l.id, l.mc_version, l.modloader); } Ok(()) } -- cgit v1.2.3