1 error: called `map(..).flatten()` on `Iterator`
2 --> $DIR/map_flatten_fixable.rs:17: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:18: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:19: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:20: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:23: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:26: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:29: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 `Iterator`
46 --> $DIR/map_flatten_fixable.rs:38:10
48 LL | .map(|n| match n {
51 LL | | .saturating_add(1)
52 LL | | .saturating_add(1)
56 | |__________________^
58 help: try replacing `map` with `flat_map` and remove the `.flatten()`
60 LL ~ .flat_map(|n| match n {
62 LL + .saturating_add(1)
63 LL + .saturating_add(1)
64 LL + .saturating_add(1)
65 LL + .saturating_add(1)
66 LL + .saturating_add(1)
67 LL + .saturating_add(1)
68 LL + .saturating_add(1)
69 LL + .saturating_add(1)],
74 error: called `map(..).flatten()` on `Option`
75 --> $DIR/map_flatten_fixable.rs:58:10
79 LL | | // we need some newlines
80 LL | | // so that the span is big enough
81 LL | | // for a split output of the diagnostic
85 | |__________________^
87 help: try replacing `map` with `and_then` and remove the `.flatten()`
90 LL + // we need some newlines
91 LL + // so that the span is big enough
92 LL + // for a split output of the diagnostic
94 LL + // whitespace beforehand is important as well
98 error: aborting due to 9 previous errors