]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/unnecessary_filter_map.stderr
Auto merge of #4478 - tsurai:master, r=flip1995
[rust.git] / tests / ui / unnecessary_filter_map.stderr
index 045802047d27f8661241f22ac27d7ba394caf23c..041829c3c7855befffd745d298cfd22b07577648 100644 (file)
@@ -1,32 +1,38 @@
 error: this `.filter_map` can be written more simply using `.filter`
- --> $DIR/unnecessary_filter_map.rs:2:13
-  |
-2 |     let _ = (0..4).filter_map(|x| if x > 1 { Some(x) } else { None });
-  |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-  |
-  = note: `-D clippy::unnecessary-filter-map` implied by `-D warnings`
 --> $DIR/unnecessary_filter_map.rs:2:13
+   |
+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:3:13
-  |
-3 |     let _ = (0..4).filter_map(|x| { if x > 1 { return Some(x); }; None });
-  |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+  --> $DIR/unnecessary_filter_map.rs:3:13
+   |
+LL |       let _ = (0..4).filter_map(|x| {
+   |  _____________^
+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:4:13
-  |
-4 |       let _ = (0..4).filter_map(|x| match x {
-  |  _____________^
-5 | |         0 | 1 => None,
-6 | |         _ => Some(x),
-7 | |     });
-  | |______^
 --> $DIR/unnecessary_filter_map.rs:9:13
+   |
+LL |       let _ = (0..4).filter_map(|x| match x {
+   |  _____________^
+LL | |         0 | 1 => None,
+LL | |         _ => Some(x),
+LL | |     });
+   | |______^
 
 error: this `.filter_map` can be written more simply using `.map`
--> $DIR/unnecessary_filter_map.rs:9:13
-  |
-9 |     let _ = (0..4).filter_map(|x| Some(x + 1));
-  |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 --> $DIR/unnecessary_filter_map.rs:14:13
+   |
+LL |     let _ = (0..4).filter_map(|x| Some(x + 1));
+   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: aborting due to 4 previous errors