]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/filter_methods.stderr
iterate List by value
[rust.git] / tests / ui / filter_methods.stderr
index c10d673148a91b8ec8724395d98be3a510ea8aac..84a957a374c6b7c1352e8c06f36831ef514de86d 100644 (file)
@@ -1,13 +1,14 @@
-error: called `filter(p).map(q)` on an `Iterator`. This is more succinctly expressed by calling `.filter_map(..)` instead.
-  --> $DIR/filter_methods.rs:14:21
+error: called `filter(p).map(q)` on an `Iterator`
+  --> $DIR/filter_methods.rs:5:21
    |
 LL |     let _: Vec<_> = vec![5; 6].into_iter().filter(|&x| x == 0).map(|x| x * 2).collect();
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: `-D clippy::filter-map` implied by `-D warnings`
+   = help: this is more succinctly expressed by calling `.filter_map(..)` instead
 
-error: called `filter(p).flat_map(q)` on an `Iterator`. This is more succinctly expressed by calling `.flat_map(..)` and filtering by returning an empty Iterator.
-  --> $DIR/filter_methods.rs:16:21
+error: called `filter(p).flat_map(q)` on an `Iterator`
+  --> $DIR/filter_methods.rs:7:21
    |
 LL |       let _: Vec<_> = vec![5_i8; 6]
    |  _____________________^
@@ -15,9 +16,11 @@ LL | |         .into_iter()
 LL | |         .filter(|&x| x == 0)
 LL | |         .flat_map(|x| x.checked_mul(2))
    | |_______________________________________^
+   |
+   = help: this is more succinctly expressed by calling `.flat_map(..)` and filtering by returning `iter::empty()`
 
-error: called `filter_map(p).flat_map(q)` on an `Iterator`. This is more succinctly expressed by calling `.flat_map(..)` and filtering by returning an empty Iterator.
-  --> $DIR/filter_methods.rs:22:21
+error: called `filter_map(p).flat_map(q)` on an `Iterator`
+  --> $DIR/filter_methods.rs:13:21
    |
 LL |       let _: Vec<_> = vec![5_i8; 6]
    |  _____________________^
@@ -25,9 +28,11 @@ LL | |         .into_iter()
 LL | |         .filter_map(|x| x.checked_mul(2))
 LL | |         .flat_map(|x| x.checked_mul(2))
    | |_______________________________________^
+   |
+   = help: this is more succinctly expressed by calling `.flat_map(..)` and filtering by returning `iter::empty()`
 
-error: called `filter_map(p).map(q)` on an `Iterator`. This is more succinctly expressed by only calling `.filter_map(..)` instead.
-  --> $DIR/filter_methods.rs:28:21
+error: called `filter_map(p).map(q)` on an `Iterator`
+  --> $DIR/filter_methods.rs:19:21
    |
 LL |       let _: Vec<_> = vec![5_i8; 6]
    |  _____________________^
@@ -35,6 +40,8 @@ LL | |         .into_iter()
 LL | |         .filter_map(|x| x.checked_mul(2))
 LL | |         .map(|x| x.checked_mul(2))
    | |__________________________________^
+   |
+   = help: this is more succinctly expressed by only calling `.filter_map(..)` instead
 
 error: aborting due to 4 previous errors