diff --git a/Cargo.toml b/Cargo.toml index 033aa3585..dcf6bd235 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -136,6 +136,7 @@ testutils = { path = "lib/testutils" } explicit_iter_loop = "warn" flat_map_option = "warn" implicit_clone = "warn" +needless_for_each = "warn" semicolon_if_nothing_returned = "warn" uninlined_format_args = "warn" diff --git a/cli/src/movement_util.rs b/cli/src/movement_util.rs index eadc059a3..9d5913a80 100644 --- a/cli/src/movement_util.rs +++ b/cli/src/movement_util.rs @@ -101,7 +101,7 @@ impl Direction { let template = workspace_command.commit_summary_template(); let mut cmd_err = user_error(err_msg); - commits.iter().for_each(|commit| { + for commit in commits { cmd_err.add_formatted_hint_with(|formatter| { if args.should_edit { write!(formatter, "Working copy: ")?; @@ -110,7 +110,7 @@ impl Direction { } template.format(commit, formatter) }); - }); + } cmd_err }