1 error: called `map(..).flatten()` on an `Iterator`
2 --> $DIR/map_flatten.rs:16:46
4 LL | let _: Vec<_> = vec![5_i8; 6].into_iter().map(option_id).flatten().collect();
5 | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using `filter_map` instead: `.filter_map(option_id)`
7 = note: `-D clippy::map-flatten` implied by `-D warnings`
9 error: called `map(..).flatten()` on an `Iterator`
10 --> $DIR/map_flatten.rs:17:46
12 LL | let _: Vec<_> = vec![5_i8; 6].into_iter().map(option_id_ref).flatten().collect();
13 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using `filter_map` instead: `.filter_map(option_id_ref)`
15 error: called `map(..).flatten()` on an `Iterator`
16 --> $DIR/map_flatten.rs:18:46
18 LL | let _: Vec<_> = vec![5_i8; 6].into_iter().map(option_id_closure).flatten().collect();
19 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using `filter_map` instead: `.filter_map(option_id_closure)`
21 error: called `map(..).flatten()` on an `Iterator`
22 --> $DIR/map_flatten.rs:19:46
24 LL | let _: Vec<_> = vec![5_i8; 6].into_iter().map(|x| x.checked_add(1)).flatten().collect();
25 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using `filter_map` instead: `.filter_map(|x| x.checked_add(1))`
27 error: called `map(..).flatten()` on an `Iterator`
28 --> $DIR/map_flatten.rs:22:46
30 LL | let _: Vec<_> = vec![5_i8; 6].into_iter().map(|x| 0..x).flatten().collect();
31 | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try using `flat_map` instead: `.flat_map(|x| 0..x)`
33 error: called `map(..).flatten()` on an `Option`
34 --> $DIR/map_flatten.rs:25:39
36 LL | let _: Option<_> = (Some(Some(1))).map(|x| x).flatten();
37 | ^^^^^^^^^^^^^^^^^^^^^ help: try using `and_then` instead: `.and_then(|x| x)`
39 error: aborting due to 6 previous errors