error: this `.filter_map` can be written more simply using `.filter`
- --> $DIR/unnecessary_filter_map.rs:11:13
+ --> $DIR/unnecessary_filter_map.rs:2:13
|
-11 | let _ = (0..4).filter_map(|x| if x > 1 { Some(x) } else { None });
+LL | let _ = (0..4).filter_map(|x| if x > 1 { Some(x) } else { None });
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::unnecessary-filter-map` implied by `-D warnings`
error: this `.filter_map` can be written more simply using `.filter`
- --> $DIR/unnecessary_filter_map.rs:12:13
+ --> $DIR/unnecessary_filter_map.rs:3:13
|
-12 | let _ = (0..4).filter_map(|x| {
+LL | let _ = (0..4).filter_map(|x| {
| _____________^
-13 | | if x > 1 {
-14 | | return Some(x);
-15 | | };
-16 | | None
-17 | | });
+LL | | if x > 1 {
+LL | | return Some(x);
+LL | | };
+LL | | None
+LL | | });
| |______^
error: this `.filter_map` can be written more simply using `.filter`
- --> $DIR/unnecessary_filter_map.rs:18:13
+ --> $DIR/unnecessary_filter_map.rs:9:13
|
-18 | let _ = (0..4).filter_map(|x| match x {
+LL | let _ = (0..4).filter_map(|x| match x {
| _____________^
-19 | | 0 | 1 => None,
-20 | | _ => Some(x),
-21 | | });
+LL | | 0 | 1 => None,
+LL | | _ => Some(x),
+LL | | });
| |______^
error: this `.filter_map` can be written more simply using `.map`
- --> $DIR/unnecessary_filter_map.rs:23:13
+ --> $DIR/unnecessary_filter_map.rs:14:13
|
-23 | let _ = (0..4).filter_map(|x| Some(x + 1));
+LL | let _ = (0..4).filter_map(|x| Some(x + 1));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 4 previous errors