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 3, 2024
1 parent 1d8eb2b commit 03619d0
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 = "deny"
flat_map_option = "deny"
implicit_clone = "deny"
needless_for_each = "deny"
semicolon_if_nothing_returned = "deny"
uninlined_format_args = "deny"

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 03619d0

Please sign in to comment.