summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/option_filter_map.stderr
blob: 4a030ac9ab045440cbc69b85688cb3d0159d1ccb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
error: `filter` for `Some` followed by `unwrap`
  --> $DIR/option_filter_map.rs:6:27
   |
LL |     let _ = Some(Some(1)).filter(Option::is_some).map(Option::unwrap);
   |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `flatten` instead: `flatten()`
   |
   = note: `-D clippy::option-filter-map` implied by `-D warnings`

error: `filter` for `Some` followed by `unwrap`
  --> $DIR/option_filter_map.rs:7:27
   |
LL |     let _ = Some(Some(1)).filter(|o| o.is_some()).map(|o| o.unwrap());
   |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `flatten` instead: `flatten()`

error: `filter` for `Some` followed by `unwrap`
  --> $DIR/option_filter_map.rs:8:35
   |
LL |     let _ = Some(1).map(odds_out).filter(Option::is_some).map(Option::unwrap);
   |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `flatten` instead: `flatten()`

error: `filter` for `Some` followed by `unwrap`
  --> $DIR/option_filter_map.rs:9:35
   |
LL |     let _ = Some(1).map(odds_out).filter(|o| o.is_some()).map(|o| o.unwrap());
   |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `flatten` instead: `flatten()`

error: `filter` for `Some` followed by `unwrap`
  --> $DIR/option_filter_map.rs:11:39
   |
LL |     let _ = vec![Some(1)].into_iter().filter(Option::is_some).map(Option::unwrap);
   |                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `flatten` instead: `flatten()`

error: `filter` for `Some` followed by `unwrap`
  --> $DIR/option_filter_map.rs:12:39
   |
LL |     let _ = vec![Some(1)].into_iter().filter(|o| o.is_some()).map(|o| o.unwrap());
   |                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `flatten` instead: `flatten()`

error: `filter` for `Some` followed by `unwrap`
  --> $DIR/option_filter_map.rs:16:10
   |
LL |           .filter(Option::is_some)
   |  __________^
LL | |         .map(Option::unwrap);
   | |____________________________^ help: consider using `flatten` instead: `flatten()`

error: `filter` for `Some` followed by `unwrap`
  --> $DIR/option_filter_map.rs:21:10
   |
LL |           .filter(|o| o.is_some())
   |  __________^
LL | |         .map(|o| o.unwrap());
   | |____________________________^ help: consider using `flatten` instead: `flatten()`

error: aborting due to 8 previous errors