Skip to content

Commit

Permalink
style: use explicit loop instead of .for_each() in simple cases
Browse files Browse the repository at this point in the history
  • Loading branch information
samueltardieu committed Oct 4, 2024
1 parent 062eb24 commit 3ab3fd0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
4 changes: 2 additions & 2 deletions cli/src/movement_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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: ")?;
Expand All @@ -110,7 +110,7 @@ impl Direction {
}
template.format(commit, formatter)
});
});
}

cmd_err
}
Expand Down

0 comments on commit 3ab3fd0

Please sign in to comment.