File tree Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 1+ // run-rustfix
2+
3+ #![warn(clippy::all, clippy::pedantic)]
4+ #![allow(clippy::missing_docs_in_private_items)]
5+
6+ fn main() {
7+ let _: Vec<_> = vec![5_i8; 6].into_iter().flat_map(|x| 0..x).collect();
8+ }
Original file line number Diff line number Diff line change 1+ // run-rustfix
2+
13#![ warn( clippy:: all, clippy:: pedantic) ]
24#![ allow( clippy:: missing_docs_in_private_items) ]
35
Original file line number Diff line number Diff line change 11error: called `map(..).flatten()` on an `Iterator`. This is more succinctly expressed by calling `.flat_map(..)`
2- --> $DIR/map_flatten.rs:5 :21
2+ --> $DIR/map_flatten.rs:7 :21
33 |
44LL | let _: Vec<_> = vec![5_i8; 6].into_iter().map(|x| 0..x).flatten().collect();
55 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using flat_map instead: `vec![5_i8; 6].into_iter().flat_map(|x| 0..x)`
You can’t perform that action at this time.
0 commit comments