1
1
error: `filter` for `Some` followed by `unwrap`
2
- --> $DIR/option_filter_map.rs:12 :13
2
+ --> $DIR/option_filter_map.rs:8 :13
3
3
|
4
4
LL | let _ = Some(Some(1)).filter(Option::is_some).map(Option::unwrap);
5
5
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `flatten` instead: `Some(Some(1)).flatten()`
6
6
|
7
7
= note: `-D clippy::option-filter-map` implied by `-D warnings`
8
8
9
9
error: `filter` for `Some` followed by `unwrap`
10
- --> $DIR/option_filter_map.rs:13 :13
10
+ --> $DIR/option_filter_map.rs:9 :13
11
11
|
12
12
LL | let _ = Some(Some(1)).filter(|o| o.is_some()).map(|o| o.unwrap());
13
13
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `flatten` instead: `Some(Some(1)).flatten()`
14
14
15
15
error: `filter` for `Some` followed by `unwrap`
16
- --> $DIR/option_filter_map.rs:14 :13
16
+ --> $DIR/option_filter_map.rs:10 :13
17
17
|
18
18
LL | let _ = Some(1).map(odds_out).filter(Option::is_some).map(Option::unwrap);
19
19
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `flatten` instead: `Some(1).map(odds_out).flatten()`
20
20
21
21
error: `filter` for `Some` followed by `unwrap`
22
- --> $DIR/option_filter_map.rs:15 :13
22
+ --> $DIR/option_filter_map.rs:11 :13
23
23
|
24
24
LL | let _ = Some(1).map(odds_out).filter(|o| o.is_some()).map(|o| o.unwrap());
25
25
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `flatten` instead: `Some(1).map(odds_out).flatten()`
26
26
27
27
error: `filter` for `Some` followed by `unwrap`
28
- --> $DIR/option_filter_map.rs:17 :13
28
+ --> $DIR/option_filter_map.rs:13 :13
29
29
|
30
30
LL | let _ = vec![Some(1)].into_iter().filter(Option::is_some).map(Option::unwrap);
31
31
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `flatten` instead: `vec![Some(1)].into_iter().flatten()`
32
32
33
33
error: `filter` for `Some` followed by `unwrap`
34
- --> $DIR/option_filter_map.rs:18 :13
34
+ --> $DIR/option_filter_map.rs:14 :13
35
35
|
36
36
LL | let _ = vec![Some(1)].into_iter().filter(|o| o.is_some()).map(|o| o.unwrap());
37
37
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `flatten` instead: `vec![Some(1)].into_iter().flatten()`
38
38
39
39
error: `filter` for `Some` followed by `unwrap`
40
- --> $DIR/option_filter_map.rs:19 :13
40
+ --> $DIR/option_filter_map.rs:15 :13
41
41
|
42
42
LL | let _ = vec![1]
43
43
| _____________^
@@ -55,7 +55,7 @@ LL | .map(odds_out).flatten();
55
55
|
56
56
57
57
error: `filter` for `Some` followed by `unwrap`
58
- --> $DIR/option_filter_map.rs:24 :13
58
+ --> $DIR/option_filter_map.rs:20 :13
59
59
|
60
60
LL | let _ = vec![1]
61
61
| _____________^
0 commit comments