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
-
10
1
error: called `filter(..).map(..)` on an `Iterator`
11
- --> $DIR/filter_methods.rs:5 :21
2
+ --> $DIR/filter_methods.rs:6 :21
12
3
|
13
4
LL | let _: Vec<_> = vec![5; 6].into_iter().filter(|&x| x == 0).map(|x| x * 2).collect();
14
5
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
15
6
|
16
7
= note: `-D clippy::filter-map` implied by `-D warnings`
17
8
= help: this is more succinctly expressed by calling `.filter_map(..)` instead
18
9
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
-
31
10
error: called `filter(..).flat_map(..)` on an `Iterator`
32
- --> $DIR/filter_methods.rs:7 :21
11
+ --> $DIR/filter_methods.rs:8 :21
33
12
|
34
13
LL | let _: Vec<_> = vec![5_i8; 6]
35
14
| _____________________^
@@ -40,20 +19,8 @@ LL | | .flat_map(|x| x.checked_mul(2))
40
19
|
41
20
= help: this is more succinctly expressed by calling `.flat_map(..)` and filtering by returning `iter::empty()`
42
21
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
-
55
22
error: called `filter_map(..).flat_map(..)` on an `Iterator`
56
- --> $DIR/filter_methods.rs:13 :21
23
+ --> $DIR/filter_methods.rs:14 :21
57
24
|
58
25
LL | let _: Vec<_> = vec![5_i8; 6]
59
26
| _____________________^
@@ -64,20 +31,8 @@ LL | | .flat_map(|x| x.checked_mul(2))
64
31
|
65
32
= help: this is more succinctly expressed by calling `.flat_map(..)` and filtering by returning `iter::empty()`
66
33
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
-
79
34
error: called `filter_map(..).map(..)` on an `Iterator`
80
- --> $DIR/filter_methods.rs:19 :21
35
+ --> $DIR/filter_methods.rs:20 :21
81
36
|
82
37
LL | let _: Vec<_> = vec![5_i8; 6]
83
38
| _____________________^
@@ -88,5 +43,5 @@ LL | | .map(|x| x.checked_mul(2))
88
43
|
89
44
= help: this is more succinctly expressed by only calling `.filter_map(..)` instead
90
45
91
- error: aborting due to 8 previous errors
46
+ error: aborting due to 4 previous errors
92
47
0 commit comments