11error: 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
33 |
44LL | v.clone().iter().filter_map(|i| (i % 2 == 0).then(|| i + 1));
55 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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));
88 = help: to override `-D warnings` add `#[allow(clippy::filter_map_bool_then)]`
99
1010error: 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
1212 |
1313LL | v.clone().into_iter().filter_map(|i| (i % 2 == 0).then(|| i + 1));
1414 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `filter` then `map` instead: `filter(|&i| (i % 2 == 0)).map(|i| i + 1)`
1515
1616error: 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
1818 |
1919LL | .filter_map(|i| -> Option<_> { (i % 2 == 0).then(|| i + 1) });
2020 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `filter` then `map` instead: `filter(|&i| (i % 2 == 0)).map(|i| i + 1)`
2121
2222error: 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
2424 |
2525LL | .filter_map(|i| (i % 2 == 0).then(|| i + 1));
2626 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `filter` then `map` instead: `filter(|&i| (i % 2 == 0)).map(|i| i + 1)`
2727
2828error: 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
3030 |
3131LL | .filter_map(|i| (i.clone() % 2 == 0).then(|| i + 1));
3232 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `filter` then `map` instead: `filter(|&i| (i.clone() % 2 == 0)).map(|i| i + 1)`
3333
3434error: 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
3636 |
3737LL | v.clone().iter().filter_map(|i| (i == &NonCopy).then(|| i));
3838 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `filter` then `map` instead: `filter(|&i| (i == &NonCopy)).map(|i| i)`
3939
4040error: 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
4242 |
4343LL | let _: Vec<usize> = bools.iter().enumerate().filter_map(|(i, b)| b.then(|| i)).collect();
4444 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `filter` then `map` instead: `filter(|&(i, b)| *b).map(|(i, b)| i)`
4545
4646error: 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
4848 |
4949LL | let _: Vec<usize> = bools.iter().enumerate().filter_map(|(i, b)| b.then(|| i)).collect();
5050 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `filter` then `map` instead: `filter(|&(i, b)| ***b).map(|(i, b)| i)`
5151
5252error: 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
5454 |
5555LL | let _: Vec<usize> = bools.iter().enumerate().filter_map(|(i, b)| b.then(|| i)).collect();
5656 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `filter` then `map` instead: `filter(|&(i, b)| **b).map(|(i, b)| i)`
5757
5858error: 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
6060 |
6161LL | let _: Vec<usize> = bools.iter().enumerate().filter_map(|(i, b)| b.then(|| i)).collect();
6262 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `filter` then `map` instead: `filter(|&(i, b)| ****b).map(|(i, b)| i)`
0 commit comments