You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Auto merge of #5084 - JohnTitor:clean-up-span-lint, r=flip1995
Clean up `span_lint` in `methods/mod.rs`
Uses `span_help_and_lint` instead of `span_lint` and `span_lint_and_sugg` instead of `span_lint_and_then`.
changelog: none
= note: `-D clippy::filter-map` implied by `-D warnings`
8
+
= help: this is more succinctly expressed by calling `.filter_map(..)` instead
8
9
9
-
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.
10
+
error: called `filter(p).flat_map(q)` on an `Iterator`
10
11
--> $DIR/filter_methods.rs:7:21
11
12
|
12
13
LL | let _: Vec<_> = vec![5_i8; 6]
@@ -15,8 +16,10 @@ LL | | .into_iter()
15
16
LL | | .filter(|&x| x == 0)
16
17
LL | | .flat_map(|x| x.checked_mul(2))
17
18
| |_______________________________________^
19
+
|
20
+
= help: this is more succinctly expressed by calling `.flat_map(..)` and filtering by returning `iter::empty()`
18
21
19
-
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.
22
+
error: called `filter_map(p).flat_map(q)` on an `Iterator`
20
23
--> $DIR/filter_methods.rs:13:21
21
24
|
22
25
LL | let _: Vec<_> = vec![5_i8; 6]
@@ -25,8 +28,10 @@ LL | | .into_iter()
25
28
LL | | .filter_map(|x| x.checked_mul(2))
26
29
LL | | .flat_map(|x| x.checked_mul(2))
27
30
| |_______________________________________^
31
+
|
32
+
= help: this is more succinctly expressed by calling `.flat_map(..)` and filtering by returning `iter::empty()`
28
33
29
-
error: called `filter_map(p).map(q)` on an `Iterator`. This is more succinctly expressed by only calling `.filter_map(..)` instead.
34
+
error: called `filter_map(p).map(q)` on an `Iterator`
30
35
--> $DIR/filter_methods.rs:19:21
31
36
|
32
37
LL | let _: Vec<_> = vec![5_i8; 6]
@@ -35,6 +40,8 @@ LL | | .into_iter()
35
40
LL | | .filter_map(|x| x.checked_mul(2))
36
41
LL | | .map(|x| x.checked_mul(2))
37
42
| |__________________________________^
43
+
|
44
+
= help: this is more succinctly expressed by only calling `.filter_map(..)` instead
0 commit comments