11error: this `.filter_map(..)` can be written more simply using `.filter(..)`
2- --> tests/ui/unnecessary_filter_map.rs:4:13
2+ --> tests/ui/unnecessary_filter_map.rs:4:20
33 |
44LL | let _ = (0..4).filter_map(|x| if x > 1 { Some(x) } else { None });
5- | ^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66 |
77 = note: `-D clippy::unnecessary-filter-map` implied by `-D warnings`
88 = help: to override `-D warnings` add `#[allow(clippy::unnecessary_filter_map)]`
99
1010error: this `.filter_map(..)` can be written more simply using `.filter(..)`
11- --> tests/ui/unnecessary_filter_map.rs:7:13
11+ --> tests/ui/unnecessary_filter_map.rs:7:20
1212 |
1313LL | let _ = (0..4).filter_map(|x| {
14- | _____________ ^
14+ | ____________________ ^
1515LL | |
1616LL | |
1717LL | | if x > 1 {
@@ -21,33 +21,33 @@ LL | | });
2121 | |______^
2222
2323error: this `.filter_map(..)` can be written more simply using `.filter(..)`
24- --> tests/ui/unnecessary_filter_map.rs:15:13
24+ --> tests/ui/unnecessary_filter_map.rs:15:20
2525 |
2626LL | let _ = (0..4).filter_map(|x| match x {
27- | _____________ ^
27+ | ____________________ ^
2828LL | |
2929LL | | 0 | 1 => None,
3030LL | | _ => Some(x),
3131LL | | });
3232 | |______^
3333
3434error: this `.filter_map(..)` can be written more simply using `.map(..)`
35- --> tests/ui/unnecessary_filter_map.rs:21:13
35+ --> tests/ui/unnecessary_filter_map.rs:21:20
3636 |
3737LL | let _ = (0..4).filter_map(|x| Some(x + 1));
38- | ^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
38+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
3939
4040error: this call to `.filter_map(..)` is unnecessary
41- --> tests/ui/unnecessary_filter_map.rs:28:61
41+ --> tests/ui/unnecessary_filter_map.rs:28:46
4242 |
4343LL | let _ = vec![Some(10), None].into_iter().filter_map(|x| Some(x));
44- | ^^^^
44+ | ^^^^^^^^^^^^^^^^^^^ ^^^^
4545
4646error: this `.filter_map(..)` can be written more simply using `.filter(..)`
47- --> tests/ui/unnecessary_filter_map.rs:166:14
47+ --> tests/ui/unnecessary_filter_map.rs:166:33
4848 |
4949LL | let _x = std::iter::once(1).filter_map(|n| (n > 1).then_some(n));
50- | ^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
50+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5151
5252error: aborting due to 6 previous errors
5353
0 commit comments