1- error: non-binding `let` on a type that implements `Drop`
2- --> $DIR/filter_methods.rs:5:5
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::let-underscore-drop` implied by `-D warnings`
8- = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`
9-
101error: called `filter(..).map(..)` on an `Iterator`
11- --> $DIR/filter_methods.rs:5 :21
2+ --> $DIR/filter_methods.rs:6 :21
123 |
134LL | let _: Vec<_> = vec![5; 6].into_iter().filter(|&x| x == 0).map(|x| x * 2).collect();
145 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
156 |
167 = note: `-D clippy::filter-map` implied by `-D warnings`
178 = help: this is more succinctly expressed by calling `.filter_map(..)` instead
189
19- error: non-binding `let` on a type that implements `Drop`
20- --> $DIR/filter_methods.rs:7:5
21- |
22- LL | / let _: Vec<_> = vec![5_i8; 6]
23- LL | | .into_iter()
24- LL | | .filter(|&x| x == 0)
25- LL | | .flat_map(|x| x.checked_mul(2))
26- LL | | .collect();
27- | |___________________^
28- |
29- = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`
30-
3110error: called `filter(..).flat_map(..)` on an `Iterator`
32- --> $DIR/filter_methods.rs:7 :21
11+ --> $DIR/filter_methods.rs:8 :21
3312 |
3413LL | let _: Vec<_> = vec![5_i8; 6]
3514 | _____________________^
@@ -40,20 +19,8 @@ LL | | .flat_map(|x| x.checked_mul(2))
4019 |
4120 = help: this is more succinctly expressed by calling `.flat_map(..)` and filtering by returning `iter::empty()`
4221
43- error: non-binding `let` on a type that implements `Drop`
44- --> $DIR/filter_methods.rs:13:5
45- |
46- LL | / let _: Vec<_> = vec![5_i8; 6]
47- LL | | .into_iter()
48- LL | | .filter_map(|x| x.checked_mul(2))
49- LL | | .flat_map(|x| x.checked_mul(2))
50- LL | | .collect();
51- | |___________________^
52- |
53- = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`
54-
5522error: called `filter_map(..).flat_map(..)` on an `Iterator`
56- --> $DIR/filter_methods.rs:13 :21
23+ --> $DIR/filter_methods.rs:14 :21
5724 |
5825LL | let _: Vec<_> = vec![5_i8; 6]
5926 | _____________________^
@@ -64,20 +31,8 @@ LL | | .flat_map(|x| x.checked_mul(2))
6431 |
6532 = help: this is more succinctly expressed by calling `.flat_map(..)` and filtering by returning `iter::empty()`
6633
67- error: non-binding `let` on a type that implements `Drop`
68- --> $DIR/filter_methods.rs:19:5
69- |
70- LL | / let _: Vec<_> = vec![5_i8; 6]
71- LL | | .into_iter()
72- LL | | .filter_map(|x| x.checked_mul(2))
73- LL | | .map(|x| x.checked_mul(2))
74- LL | | .collect();
75- | |___________________^
76- |
77- = help: consider using an underscore-prefixed named binding or dropping explicitly with `std::mem::drop`
78-
7934error: called `filter_map(..).map(..)` on an `Iterator`
80- --> $DIR/filter_methods.rs:19 :21
35+ --> $DIR/filter_methods.rs:20 :21
8136 |
8237LL | let _: Vec<_> = vec![5_i8; 6]
8338 | _____________________^
@@ -88,5 +43,5 @@ LL | | .map(|x| x.checked_mul(2))
8843 |
8944 = help: this is more succinctly expressed by only calling `.filter_map(..)` instead
9045
91- error: aborting due to 8 previous errors
46+ error: aborting due to 4 previous errors
9247
0 commit comments