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
+
1
3
#![ warn( clippy:: all, clippy:: pedantic) ]
2
4
#![ allow( clippy:: missing_docs_in_private_items) ]
3
5
Original file line number Diff line number Diff line change 1
1
error: 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
3
3
|
4
4
LL | let _: Vec<_> = vec![5_i8; 6].into_iter().map(|x| 0..x).flatten().collect();
5
5
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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