11error: called `map(<f>).unwrap_or_default()` on an `Option` value
2- --> tests/ui/manual_is_variant_and.rs:51 :17
2+ --> tests/ui/manual_is_variant_and.rs:13 :17
33 |
44LL | let _ = opt.map(|x| x > 1)
55 | _________________^
@@ -11,7 +11,7 @@ LL | | .unwrap_or_default();
1111 = help: to override `-D warnings` add `#[allow(clippy::manual_is_variant_and)]`
1212
1313error: called `map(<f>).unwrap_or_default()` on an `Option` value
14- --> tests/ui/manual_is_variant_and.rs:56 :17
14+ --> tests/ui/manual_is_variant_and.rs:18 :17
1515 |
1616LL | let _ = opt.map(|x| {
1717 | _________________^
@@ -30,52 +30,28 @@ LL ~ });
3030 |
3131
3232error: called `map(<f>).unwrap_or_default()` on an `Option` value
33- --> tests/ui/manual_is_variant_and.rs:61 :17
33+ --> tests/ui/manual_is_variant_and.rs:23 :17
3434 |
3535LL | let _ = opt.map(|x| x > 1).unwrap_or_default();
3636 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `is_some_and(|x| x > 1)`
3737
3838error: called `map(<f>).unwrap_or_default()` on an `Option` value
39- --> tests/ui/manual_is_variant_and.rs:64 :10
39+ --> tests/ui/manual_is_variant_and.rs:26 :10
4040 |
4141LL | .map(|x| x > 1)
4242 | __________^
4343LL | |
4444LL | | .unwrap_or_default();
4545 | |____________________________^ help: use: `is_some_and(|x| x > 1)`
4646
47- error: called `.map() == Some()`
48- --> tests/ui/manual_is_variant_and.rs:68:13
49- |
50- LL | let _ = Some(2).map(|x| x % 2 == 0) == Some(true);
51- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `Some(2).is_some_and(|x| x % 2 == 0)`
52-
53- error: called `.map() != Some()`
54- --> tests/ui/manual_is_variant_and.rs:70:13
55- |
56- LL | let _ = Some(2).map(|x| x % 2 == 0) != Some(true);
57- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `Some(2).is_none_or(|x| x % 2 == 0)`
58-
59- error: called `.map() == Some()`
60- --> tests/ui/manual_is_variant_and.rs:72:13
61- |
62- LL | let _ = Some(2).map(|x| x % 2 == 0) == some_true!();
63- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `Some(2).is_some_and(|x| x % 2 == 0)`
64-
65- error: called `.map() != Some()`
66- --> tests/ui/manual_is_variant_and.rs:74:13
67- |
68- LL | let _ = Some(2).map(|x| x % 2 == 0) != some_false!();
69- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `Some(2).is_none_or(|x| x % 2 == 0)`
70-
7147error: called `map(<f>).unwrap_or_default()` on an `Option` value
72- --> tests/ui/manual_is_variant_and.rs:81 :18
48+ --> tests/ui/manual_is_variant_and.rs:34 :18
7349 |
7450LL | let _ = opt2.map(char::is_alphanumeric).unwrap_or_default(); // should lint
7551 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `is_some_and(char::is_alphanumeric)`
7652
7753error: called `map(<f>).unwrap_or_default()` on a `Result` value
78- --> tests/ui/manual_is_variant_and.rs:99 :17
54+ --> tests/ui/manual_is_variant_and.rs:44 :17
7955 |
8056LL | let _ = res.map(|x| {
8157 | _________________^
@@ -94,37 +70,19 @@ LL ~ });
9470 |
9571
9672error: called `map(<f>).unwrap_or_default()` on a `Result` value
97- --> tests/ui/manual_is_variant_and.rs:104 :17
73+ --> tests/ui/manual_is_variant_and.rs:49 :17
9874 |
9975LL | let _ = res.map(|x| x > 1)
10076 | _________________^
10177LL | |
10278LL | | .unwrap_or_default();
10379 | |____________________________^ help: use: `is_ok_and(|x| x > 1)`
10480
105- error: called `.map() == Ok()`
106- --> tests/ui/manual_is_variant_and.rs:108:13
107- |
108- LL | let _ = Ok::<usize, ()>(2).map(|x| x % 2 == 0) == Ok(true);
109- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `Ok::<usize, ()>(2).is_ok_and(|x| x % 2 == 0)`
110-
111- error: called `.map() != Ok()`
112- --> tests/ui/manual_is_variant_and.rs:110:13
113- |
114- LL | let _ = Ok::<usize, ()>(2).map(|x| x % 2 == 0) != Ok(true);
115- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `!Ok::<usize, ()>(2).is_ok_and(|x| x % 2 == 0)`
116-
117- error: called `.map() != Ok()`
118- --> tests/ui/manual_is_variant_and.rs:112:13
119- |
120- LL | let _ = Ok::<usize, ()>(2).map(|x| x % 2 == 0) != Ok(true);
121- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `!Ok::<usize, ()>(2).is_ok_and(|x| x % 2 == 0)`
122-
12381error: called `map(<f>).unwrap_or_default()` on a `Result` value
124- --> tests/ui/manual_is_variant_and.rs:119 :18
82+ --> tests/ui/manual_is_variant_and.rs:57 :18
12583 |
12684LL | let _ = res2.map(char::is_alphanumeric).unwrap_or_default(); // should lint
12785 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `is_ok_and(char::is_alphanumeric)`
12886
129- error: aborting due to 15 previous errors
87+ error: aborting due to 8 previous errors
13088
0 commit comments