|
1 | 1 | error: called `map(..).flatten()` on `Iterator` |
2 | | - --> $DIR/map_flatten_fixable.rs:17:47 |
| 2 | + --> $DIR/map_flatten_fixable.rs:18:47 |
3 | 3 | | |
4 | 4 | LL | let _: Vec<_> = vec![5_i8; 6].into_iter().map(option_id).flatten().collect(); |
5 | 5 | | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try replacing `map` with `filter_map` and remove the `.flatten()`: `filter_map(option_id)` |
6 | 6 | | |
7 | 7 | = note: `-D clippy::map-flatten` implied by `-D warnings` |
8 | 8 |
|
9 | 9 | error: called `map(..).flatten()` on `Iterator` |
10 | | - --> $DIR/map_flatten_fixable.rs:18:47 |
| 10 | + --> $DIR/map_flatten_fixable.rs:19:47 |
11 | 11 | | |
12 | 12 | LL | let _: Vec<_> = vec![5_i8; 6].into_iter().map(option_id_ref).flatten().collect(); |
13 | 13 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try replacing `map` with `filter_map` and remove the `.flatten()`: `filter_map(option_id_ref)` |
14 | 14 |
|
15 | 15 | error: called `map(..).flatten()` on `Iterator` |
16 | | - --> $DIR/map_flatten_fixable.rs:19:47 |
| 16 | + --> $DIR/map_flatten_fixable.rs:20:47 |
17 | 17 | | |
18 | 18 | LL | let _: Vec<_> = vec![5_i8; 6].into_iter().map(option_id_closure).flatten().collect(); |
19 | 19 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try replacing `map` with `filter_map` and remove the `.flatten()`: `filter_map(option_id_closure)` |
20 | 20 |
|
21 | 21 | error: called `map(..).flatten()` on `Iterator` |
22 | | - --> $DIR/map_flatten_fixable.rs:20:47 |
| 22 | + --> $DIR/map_flatten_fixable.rs:21:47 |
23 | 23 | | |
24 | 24 | LL | let _: Vec<_> = vec![5_i8; 6].into_iter().map(|x| x.checked_add(1)).flatten().collect(); |
25 | 25 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try replacing `map` with `filter_map` and remove the `.flatten()`: `filter_map(|x| x.checked_add(1))` |
26 | 26 |
|
27 | 27 | error: called `map(..).flatten()` on `Iterator` |
28 | | - --> $DIR/map_flatten_fixable.rs:23:47 |
| 28 | + --> $DIR/map_flatten_fixable.rs:24:47 |
29 | 29 | | |
30 | 30 | LL | let _: Vec<_> = vec![5_i8; 6].into_iter().map(|x| 0..x).flatten().collect(); |
31 | 31 | | ^^^^^^^^^^^^^^^^^^^^^^^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|x| 0..x)` |
32 | 32 |
|
33 | 33 | error: called `map(..).flatten()` on `Option` |
34 | | - --> $DIR/map_flatten_fixable.rs:26:40 |
| 34 | + --> $DIR/map_flatten_fixable.rs:27:40 |
35 | 35 | | |
36 | 36 | LL | let _: Option<_> = (Some(Some(1))).map(|x| x).flatten(); |
37 | 37 | | ^^^^^^^^^^^^^^^^^^^^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(|x| x)` |
38 | 38 |
|
39 | 39 | error: called `map(..).flatten()` on `Result` |
40 | | - --> $DIR/map_flatten_fixable.rs:29:42 |
| 40 | + --> $DIR/map_flatten_fixable.rs:30:42 |
41 | 41 | | |
42 | 42 | LL | let _: Result<_, &str> = (Ok(Ok(1))).map(|x| x).flatten(); |
43 | 43 | | ^^^^^^^^^^^^^^^^^^^^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(|x| x)` |
44 | 44 |
|
45 | 45 | error: called `map(..).flatten()` on `Iterator` |
46 | | - --> $DIR/map_flatten_fixable.rs:38:10 |
| 46 | + --> $DIR/map_flatten_fixable.rs:39:10 |
47 | 47 | | |
48 | 48 | LL | .map(|n| match n { |
49 | 49 | | __________^ |
@@ -72,7 +72,7 @@ LL ~ }); |
72 | 72 | | |
73 | 73 |
|
74 | 74 | error: called `map(..).flatten()` on `Option` |
75 | | - --> $DIR/map_flatten_fixable.rs:58:10 |
| 75 | + --> $DIR/map_flatten_fixable.rs:59:10 |
76 | 76 | | |
77 | 77 | LL | .map(|_| { |
78 | 78 | | __________^ |
|
0 commit comments