]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/filter_methods.stderr
Merge commit 'b20d4c155d2fe3a8391f86dcf9a8c49e17188703' into clippyup
[rust.git] / src / tools / clippy / tests / ui / filter_methods.stderr
1 error: called `filter(..).map(..)` on an `Iterator`
2   --> $DIR/filter_methods.rs:5:21
3    |
4 LL |     let _: Vec<_> = vec![5; 6].into_iter().filter(|&x| x == 0).map(|x| x * 2).collect();
5    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6    |
7    = note: `-D clippy::filter-map` implied by `-D warnings`
8    = help: this is more succinctly expressed by calling `.filter_map(..)` instead
9
10 error: called `filter(..).flat_map(..)` on an `Iterator`
11   --> $DIR/filter_methods.rs:7:21
12    |
13 LL |       let _: Vec<_> = vec![5_i8; 6]
14    |  _____________________^
15 LL | |         .into_iter()
16 LL | |         .filter(|&x| x == 0)
17 LL | |         .flat_map(|x| x.checked_mul(2))
18    | |_______________________________________^
19    |
20    = help: this is more succinctly expressed by calling `.flat_map(..)` and filtering by returning `iter::empty()`
21
22 error: called `filter_map(..).flat_map(..)` on an `Iterator`
23   --> $DIR/filter_methods.rs:13:21
24    |
25 LL |       let _: Vec<_> = vec![5_i8; 6]
26    |  _____________________^
27 LL | |         .into_iter()
28 LL | |         .filter_map(|x| x.checked_mul(2))
29 LL | |         .flat_map(|x| x.checked_mul(2))
30    | |_______________________________________^
31    |
32    = help: this is more succinctly expressed by calling `.flat_map(..)` and filtering by returning `iter::empty()`
33
34 error: called `filter_map(..).map(..)` on an `Iterator`
35   --> $DIR/filter_methods.rs:19:21
36    |
37 LL |       let _: Vec<_> = vec![5_i8; 6]
38    |  _____________________^
39 LL | |         .into_iter()
40 LL | |         .filter_map(|x| x.checked_mul(2))
41 LL | |         .map(|x| x.checked_mul(2))
42    | |__________________________________^
43    |
44    = help: this is more succinctly expressed by only calling `.filter_map(..)` instead
45
46 error: aborting due to 4 previous errors
47