]> git.proxmox.com Git - rustc.git/blame - src/tools/clippy/tests/ui/unnecessary_filter_map.stderr
New upstream version 1.52.1+dfsg1
[rustc.git] / src / tools / clippy / tests / ui / unnecessary_filter_map.stderr
CommitLineData
f20569fa
XL
1error: this `.filter_map` can be written more simply using `.filter`
2 --> $DIR/unnecessary_filter_map.rs:2:13
3 |
4LL | 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
9error: this `.filter_map` can be written more simply using `.filter`
10 --> $DIR/unnecessary_filter_map.rs:3:13
11 |
12LL | let _ = (0..4).filter_map(|x| {
13 | _____________^
14LL | | if x > 1 {
15LL | | return Some(x);
16LL | | };
17LL | | None
18LL | | });
19 | |______^
20
21error: this `.filter_map` can be written more simply using `.filter`
22 --> $DIR/unnecessary_filter_map.rs:9:13
23 |
24LL | let _ = (0..4).filter_map(|x| match x {
25 | _____________^
26LL | | 0 | 1 => None,
27LL | | _ => Some(x),
28LL | | });
29 | |______^
30
31error: this `.filter_map` can be written more simply using `.map`
32 --> $DIR/unnecessary_filter_map.rs:14:13
33 |
34LL | let _ = (0..4).filter_map(|x| Some(x + 1));
35 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
36
37error: aborting due to 4 previous errors
38