1
1
error: usage of `bool::then` in `filter_map`
2
- --> tests/ui/filter_map_bool_then.rs:19 :22
2
+ --> tests/ui/filter_map_bool_then.rs:20 :22
3
3
|
4
4
LL | v.clone().iter().filter_map(|i| (i % 2 == 0).then(|| i + 1));
5
5
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `filter` then `map` instead: `filter(|&i| (i % 2 == 0)).map(|i| i + 1)`
@@ -8,55 +8,55 @@ LL | v.clone().iter().filter_map(|i| (i % 2 == 0).then(|| i + 1));
8
8
= help: to override `-D warnings` add `#[allow(clippy::filter_map_bool_then)]`
9
9
10
10
error: usage of `bool::then` in `filter_map`
11
- --> tests/ui/filter_map_bool_then.rs:20 :27
11
+ --> tests/ui/filter_map_bool_then.rs:21 :27
12
12
|
13
13
LL | v.clone().into_iter().filter_map(|i| (i % 2 == 0).then(|| i + 1));
14
14
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `filter` then `map` instead: `filter(|&i| (i % 2 == 0)).map(|i| i + 1)`
15
15
16
16
error: usage of `bool::then` in `filter_map`
17
- --> tests/ui/filter_map_bool_then.rs:23 :10
17
+ --> tests/ui/filter_map_bool_then.rs:24 :10
18
18
|
19
19
LL | .filter_map(|i| -> Option<_> { (i % 2 == 0).then(|| i + 1) });
20
20
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `filter` then `map` instead: `filter(|&i| (i % 2 == 0)).map(|i| i + 1)`
21
21
22
22
error: usage of `bool::then` in `filter_map`
23
- --> tests/ui/filter_map_bool_then.rs:27 :10
23
+ --> tests/ui/filter_map_bool_then.rs:28 :10
24
24
|
25
25
LL | .filter_map(|i| (i % 2 == 0).then(|| i + 1));
26
26
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `filter` then `map` instead: `filter(|&i| (i % 2 == 0)).map(|i| i + 1)`
27
27
28
28
error: usage of `bool::then` in `filter_map`
29
- --> tests/ui/filter_map_bool_then.rs:31 :10
29
+ --> tests/ui/filter_map_bool_then.rs:32 :10
30
30
|
31
31
LL | .filter_map(|i| (i.clone() % 2 == 0).then(|| i + 1));
32
32
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `filter` then `map` instead: `filter(|&i| (i.clone() % 2 == 0)).map(|i| i + 1)`
33
33
34
34
error: usage of `bool::then` in `filter_map`
35
- --> tests/ui/filter_map_bool_then.rs:37 :22
35
+ --> tests/ui/filter_map_bool_then.rs:38 :22
36
36
|
37
37
LL | v.clone().iter().filter_map(|i| (i == &NonCopy).then(|| i));
38
38
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `filter` then `map` instead: `filter(|&i| (i == &NonCopy)).map(|i| i)`
39
39
40
40
error: usage of `bool::then` in `filter_map`
41
- --> tests/ui/filter_map_bool_then.rs:61 :50
41
+ --> tests/ui/filter_map_bool_then.rs:62 :50
42
42
|
43
43
LL | let _: Vec<usize> = bools.iter().enumerate().filter_map(|(i, b)| b.then(|| i)).collect();
44
44
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `filter` then `map` instead: `filter(|&(i, b)| *b).map(|(i, b)| i)`
45
45
46
46
error: usage of `bool::then` in `filter_map`
47
- --> tests/ui/filter_map_bool_then.rs:65 :50
47
+ --> tests/ui/filter_map_bool_then.rs:66 :50
48
48
|
49
49
LL | let _: Vec<usize> = bools.iter().enumerate().filter_map(|(i, b)| b.then(|| i)).collect();
50
50
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `filter` then `map` instead: `filter(|&(i, b)| ***b).map(|(i, b)| i)`
51
51
52
52
error: usage of `bool::then` in `filter_map`
53
- --> tests/ui/filter_map_bool_then.rs:69 :50
53
+ --> tests/ui/filter_map_bool_then.rs:70 :50
54
54
|
55
55
LL | let _: Vec<usize> = bools.iter().enumerate().filter_map(|(i, b)| b.then(|| i)).collect();
56
56
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `filter` then `map` instead: `filter(|&(i, b)| **b).map(|(i, b)| i)`
57
57
58
58
error: usage of `bool::then` in `filter_map`
59
- --> tests/ui/filter_map_bool_then.rs:80 :50
59
+ --> tests/ui/filter_map_bool_then.rs:81 :50
60
60
|
61
61
LL | let _: Vec<usize> = bools.iter().enumerate().filter_map(|(i, b)| b.then(|| i)).collect();
62
62
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `filter` then `map` instead: `filter(|&(i, b)| ****b).map(|(i, b)| i)`
0 commit comments