]> git.lizzy.rs Git - rust.git/blob - tests/ui/unnecessary_filter_map.stderr
Add license header to Rust files
[rust.git] / tests / ui / unnecessary_filter_map.stderr
1 error: this `.filter_map` can be written more simply using `.filter`
2   --> $DIR/unnecessary_filter_map.rs:12:13
3    |
4 12 |     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:13:13
11    |
12 13 |     let _ = (0..4).filter_map(|x| { if x > 1 { return Some(x); }; None });
13    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
14
15 error: this `.filter_map` can be written more simply using `.filter`
16   --> $DIR/unnecessary_filter_map.rs:14:13
17    |
18 14 |       let _ = (0..4).filter_map(|x| match x {
19    |  _____________^
20 15 | |         0 | 1 => None,
21 16 | |         _ => Some(x),
22 17 | |     });
23    | |______^
24
25 error: this `.filter_map` can be written more simply using `.map`
26   --> $DIR/unnecessary_filter_map.rs:19:13
27    |
28 19 |     let _ = (0..4).filter_map(|x| Some(x + 1));
29    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
30
31 error: aborting due to 4 previous errors
32