Skip to content

Commit 404e454

Browse files
committed
Apply needless_for_each to clippy itself
1 parent b6f2ccb commit 404e454

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lintcheck/src/output.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,9 @@ pub fn summarize_and_print_changes(
162162
fn gather_stats(warnings: &[ClippyWarning]) -> (String, HashMap<&String, usize>) {
163163
// count lint type occurrences
164164
let mut counter: HashMap<&String, usize> = HashMap::new();
165-
warnings
166-
.iter()
167-
.for_each(|wrn| *counter.entry(&wrn.name).or_insert(0) += 1);
165+
for wrn in warnings {
166+
*counter.entry(&wrn.name).or_insert(0) += 1;
167+
}
168168

169169
// collect into a tupled list for sorting
170170
let mut stats: Vec<(&&String, &usize)> = counter.iter().collect();

0 commit comments

Comments
 (0)