1
1
error: called `map(<f>).unwrap_or_default()` on an `Option` value
2
- --> tests/ui/manual_is_variant_and.rs:13 :17
2
+ --> tests/ui/manual_is_variant_and.rs:51 :17
3
3
|
4
4
LL | let _ = opt.map(|x| x > 1)
5
5
| _________________^
@@ -11,7 +11,7 @@ LL | | .unwrap_or_default();
11
11
= help: to override `-D warnings` add `#[allow(clippy::manual_is_variant_and)]`
12
12
13
13
error: called `map(<f>).unwrap_or_default()` on an `Option` value
14
- --> tests/ui/manual_is_variant_and.rs:18 :17
14
+ --> tests/ui/manual_is_variant_and.rs:56 :17
15
15
|
16
16
LL | let _ = opt.map(|x| {
17
17
| _________________^
@@ -30,28 +30,52 @@ LL ~ });
30
30
|
31
31
32
32
error: called `map(<f>).unwrap_or_default()` on an `Option` value
33
- --> tests/ui/manual_is_variant_and.rs:23 :17
33
+ --> tests/ui/manual_is_variant_and.rs:61 :17
34
34
|
35
35
LL | let _ = opt.map(|x| x > 1).unwrap_or_default();
36
36
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `is_some_and(|x| x > 1)`
37
37
38
38
error: called `map(<f>).unwrap_or_default()` on an `Option` value
39
- --> tests/ui/manual_is_variant_and.rs:26 :10
39
+ --> tests/ui/manual_is_variant_and.rs:64 :10
40
40
|
41
41
LL | .map(|x| x > 1)
42
42
| __________^
43
43
LL | |
44
44
LL | | .unwrap_or_default();
45
45
| |____________________________^ help: use: `is_some_and(|x| x > 1)`
46
46
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
+
47
71
error: called `map(<f>).unwrap_or_default()` on an `Option` value
48
- --> tests/ui/manual_is_variant_and.rs:34 :18
72
+ --> tests/ui/manual_is_variant_and.rs:81 :18
49
73
|
50
74
LL | let _ = opt2.map(char::is_alphanumeric).unwrap_or_default(); // should lint
51
75
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `is_some_and(char::is_alphanumeric)`
52
76
53
77
error: called `map(<f>).unwrap_or_default()` on a `Result` value
54
- --> tests/ui/manual_is_variant_and.rs:44 :17
78
+ --> tests/ui/manual_is_variant_and.rs:99 :17
55
79
|
56
80
LL | let _ = res.map(|x| {
57
81
| _________________^
@@ -70,19 +94,37 @@ LL ~ });
70
94
|
71
95
72
96
error: called `map(<f>).unwrap_or_default()` on a `Result` value
73
- --> tests/ui/manual_is_variant_and.rs:49 :17
97
+ --> tests/ui/manual_is_variant_and.rs:104 :17
74
98
|
75
99
LL | let _ = res.map(|x| x > 1)
76
100
| _________________^
77
101
LL | |
78
102
LL | | .unwrap_or_default();
79
103
| |____________________________^ help: use: `is_ok_and(|x| x > 1)`
80
104
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
+
81
123
error: called `map(<f>).unwrap_or_default()` on a `Result` value
82
- --> tests/ui/manual_is_variant_and.rs:57 :18
124
+ --> tests/ui/manual_is_variant_and.rs:119 :18
83
125
|
84
126
LL | let _ = res2.map(char::is_alphanumeric).unwrap_or_default(); // should lint
85
127
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `is_ok_and(char::is_alphanumeric)`
86
128
87
- error: aborting due to 8 previous errors
129
+ error: aborting due to 15 previous errors
88
130
0 commit comments