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 144b9d0 commit 591f44c
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 @@ -137,6 +137,7 @@ all = "deny"
explicit_iter_loop = "deny"
flat_map_option = "deny"
implicit_clone = "deny"
needless_for_each = "deny"
semicolon_if_nothing_returned = "deny"
# Until all documentation comments are fixed, do not warn about them
too_long_first_doc_paragraph = { level = "allow", priority = 1 }
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 591f44c

Please sign in to comment.