1 error: called `map(..).flatten()` on `Iterator`
2 --> $DIR/map_flatten_fixable.rs:18:47
4 LL | let _: Vec<_> = vec![5_i8; 6].into_iter().map(option_id).flatten().collect();
5 | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try replacing `map` with `filter_map` and remove the `.flatten()`: `filter_map(option_id)`
7 = note: `-D clippy::map-flatten` implied by `-D warnings`
9 error: called `map(..).flatten()` on `Iterator`
10 --> $DIR/map_flatten_fixable.rs:19:47
12 LL | let _: Vec<_> = vec![5_i8; 6].into_iter().map(option_id_ref).flatten().collect();
13 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try replacing `map` with `filter_map` and remove the `.flatten()`: `filter_map(option_id_ref)`
15 error: called `map(..).flatten()` on `Iterator`
16 --> $DIR/map_flatten_fixable.rs:20:47
18 LL | let _: Vec<_> = vec![5_i8; 6].into_iter().map(option_id_closure).flatten().collect();
19 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try replacing `map` with `filter_map` and remove the `.flatten()`: `filter_map(option_id_closure)`
21 error: called `map(..).flatten()` on `Iterator`
22 --> $DIR/map_flatten_fixable.rs:21:47
24 LL | let _: Vec<_> = vec![5_i8; 6].into_iter().map(|x| x.checked_add(1)).flatten().collect();
25 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try replacing `map` with `filter_map` and remove the `.flatten()`: `filter_map(|x| x.checked_add(1))`
27 error: called `map(..).flatten()` on `Iterator`
28 --> $DIR/map_flatten_fixable.rs:24:47
30 LL | let _: Vec<_> = vec![5_i8; 6].into_iter().map(|x| 0..x).flatten().collect();
31 | ^^^^^^^^^^^^^^^^^^^^^^^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|x| 0..x)`
33 error: called `map(..).flatten()` on `Option`
34 --> $DIR/map_flatten_fixable.rs:27:40
36 LL | let _: Option<_> = (Some(Some(1))).map(|x| x).flatten();
37 | ^^^^^^^^^^^^^^^^^^^^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(|x| x)`
39 error: called `map(..).flatten()` on `Result`
40 --> $DIR/map_flatten_fixable.rs:30:42
42 LL | let _: Result<_, &str> = (Ok(Ok(1))).map(|x| x).flatten();
43 | ^^^^^^^^^^^^^^^^^^^^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(|x| x)`
45 error: called `map(..).flatten()` on `Option`
46 --> $DIR/map_flatten_fixable.rs:59:10
50 LL | | // we need some newlines
51 LL | | // so that the span is big enough
52 LL | | // for a splitted output of the diagnostic
56 | |__________________^
58 help: try replacing `map` with `and_then` and remove the `.flatten()`
61 LL + // we need some newlines
62 LL + // so that the span is big enough
63 LL + // for a splitted output of the diagnostic
65 LL + // whitespace beforehand is important as well
69 error: aborting due to 8 previous errors