]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/unnecessary_filter_map.stderr
Merge commit 'ac0e10aa68325235069a842f47499852b2dee79e' into clippyup
[rust.git] / src / tools / clippy / tests / ui / unnecessary_filter_map.stderr
1 error: this `.filter_map` can be written more simply using `.filter`
2   --> $DIR/unnecessary_filter_map.rs:4:13
3    |
4 LL |     let _ = (0..4).filter_map(|x| if x > 1 { Some(x) } else { None });
5    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6    |
7    = note: `-D clippy::unnecessary-filter-map` implied by `-D warnings`
8
9 error: this `.filter_map` can be written more simply using `.filter`
10   --> $DIR/unnecessary_filter_map.rs:5:13
11    |
12 LL |       let _ = (0..4).filter_map(|x| {
13    |  _____________^
14 LL | |         if x > 1 {
15 LL | |             return Some(x);
16 LL | |         };
17 LL | |         None
18 LL | |     });
19    | |______^
20
21 error: this `.filter_map` can be written more simply using `.filter`
22   --> $DIR/unnecessary_filter_map.rs:11:13
23    |
24 LL |       let _ = (0..4).filter_map(|x| match x {
25    |  _____________^
26 LL | |         0 | 1 => None,
27 LL | |         _ => Some(x),
28 LL | |     });
29    | |______^
30
31 error: this `.filter_map` can be written more simply using `.map`
32   --> $DIR/unnecessary_filter_map.rs:16:13
33    |
34 LL |     let _ = (0..4).filter_map(|x| Some(x + 1));
35    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
36
37 error: aborting due to 4 previous errors
38