We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
needless_for_each
1 parent e5617a7 commit 520cb09Copy full SHA for 520cb09
lintcheck/src/output.rs
@@ -162,9 +162,9 @@ pub fn summarize_and_print_changes(
162
fn gather_stats(warnings: &[ClippyWarning]) -> (String, HashMap<&String, usize>) {
163
// count lint type occurrences
164
let mut counter: HashMap<&String, usize> = HashMap::new();
165
- warnings
166
- .iter()
167
- .for_each(|wrn| *counter.entry(&wrn.name).or_insert(0) += 1);
+ for wrn in warnings {
+ *counter.entry(&wrn.name).or_insert(0) += 1;
+ }
168
169
// collect into a tupled list for sorting
170
let mut stats: Vec<(&&String, &usize)> = counter.iter().collect();
0 commit comments