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