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