]> git.lizzy.rs Git - rust.git/blob - tests/ui/filter_methods.stderr
Update tests to new format of multiline errors
[rust.git] / tests / ui / filter_methods.stderr
1 error: called `filter(p).map(q)` on an `Iterator`. This is more succinctly expressed by calling `.filter_map(..)` instead.
2   --> $DIR/filter_methods.rs:8:21
3    |
4 8  |       let _: Vec<_> = vec![5; 6].into_iter()
5    |  _____________________^
6 9  | |                               .filter(|&x| x == 0)
7 10 | |                               .map(|x| x * 2)
8    | |_____________________________________________^
9    |
10    = note: #[deny(filter_map)] implied by #[deny(clippy_pedantic)]
11 note: lint level defined here
12   --> $DIR/filter_methods.rs:4:17
13    |
14 4  | #![deny(clippy, clippy_pedantic)]
15    |                 ^^^^^^^^^^^^^^^
16
17 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.
18   --> $DIR/filter_methods.rs:13:21
19    |
20 13 |       let _: Vec<_> = vec![5_i8; 6].into_iter()
21    |  _____________________^
22 14 | |                                 .filter(|&x| x == 0)
23 15 | |                                 .flat_map(|x| x.checked_mul(2))
24    | |_______________________________________________________________^
25    |
26    = note: #[deny(filter_map)] implied by #[deny(clippy_pedantic)]
27
28 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.
29   --> $DIR/filter_methods.rs:18:21
30    |
31 18 |       let _: Vec<_> = vec![5_i8; 6].into_iter()
32    |  _____________________^
33 19 | |                                 .filter_map(|x| x.checked_mul(2))
34 20 | |                                 .flat_map(|x| x.checked_mul(2))
35    | |_______________________________________________________________^
36    |
37    = note: #[deny(filter_map)] implied by #[deny(clippy_pedantic)]
38
39 error: called `filter_map(p).map(q)` on an `Iterator`. This is more succinctly expressed by only calling `.filter_map(..)` instead.
40   --> $DIR/filter_methods.rs:23:21
41    |
42 23 |       let _: Vec<_> = vec![5_i8; 6].into_iter()
43    |  _____________________^
44 24 | |                                 .filter_map(|x| x.checked_mul(2))
45 25 | |                                 .map(|x| x.checked_mul(2))
46    | |__________________________________________________________^
47    |
48    = note: #[deny(filter_map)] implied by #[deny(clippy_pedantic)]
49
50 error: aborting due to 4 previous errors
51