diff options
| author | yanglsh <yanglsh@shanghaitech.edu.cn> | 2025-05-18 14:33:50 +0800 |
|---|---|---|
| committer | yanglsh <yanglsh@shanghaitech.edu.cn> | 2025-05-20 18:07:57 +0800 |
| commit | 520cb092b894f20b79a5e2a3139cc94be238c2af (patch) | |
| tree | 0e165c6ffae481928bb28ac7248289424956e578 | |
| parent | e5617a79fba6705c36b8690f43d2ce6deb0a59d3 (diff) | |
| download | rust-520cb092b894f20b79a5e2a3139cc94be238c2af.tar.gz rust-520cb092b894f20b79a5e2a3139cc94be238c2af.zip | |
Apply `needless_for_each` to clippy itself
| -rw-r--r-- | lintcheck/src/output.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lintcheck/src/output.rs b/lintcheck/src/output.rs index dcc1ec339ef..d7fe0915121 100644 --- a/lintcheck/src/output.rs +++ b/lintcheck/src/output.rs @@ -162,9 +162,9 @@ pub fn summarize_and_print_changes( fn gather_stats(warnings: &[ClippyWarning]) -> (String, HashMap<&String, usize>) { // count lint type occurrences let mut counter: HashMap<&String, usize> = HashMap::new(); - warnings - .iter() - .for_each(|wrn| *counter.entry(&wrn.name).or_insert(0) += 1); + for wrn in warnings { + *counter.entry(&wrn.name).or_insert(0) += 1; + } // collect into a tupled list for sorting let mut stats: Vec<(&&String, &usize)> = counter.iter().collect(); |
