1
1
error: redundant pattern matching, consider using `is_none()`
2
- --> tests/ui/redundant_pattern_matching_option.rs:12 :5
2
+ --> tests/ui/redundant_pattern_matching_option.rs:11 :5
3
3
|
4
4
LL | matches!(maybe_some, None if !boolean)
5
5
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `maybe_some.is_none() && (!boolean)`
@@ -8,55 +8,55 @@ LL | matches!(maybe_some, None if !boolean)
8
8
= help: to override `-D warnings` add `#[allow(clippy::redundant_pattern_matching)]`
9
9
10
10
error: redundant pattern matching, consider using `is_none()`
11
- --> tests/ui/redundant_pattern_matching_option.rs:17 :13
11
+ --> tests/ui/redundant_pattern_matching_option.rs:16 :13
12
12
|
13
13
LL | let _ = matches!(maybe_some, None if boolean || boolean2); // guard needs parentheses
14
14
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `maybe_some.is_none() && (boolean || boolean2)`
15
15
16
16
error: redundant pattern matching, consider using `is_none()`
17
- --> tests/ui/redundant_pattern_matching_option.rs:33 :12
17
+ --> tests/ui/redundant_pattern_matching_option.rs:32 :12
18
18
|
19
19
LL | if let None = None::<()> {}
20
20
| -------^^^^------------- help: try: `if None::<()>.is_none()`
21
21
22
22
error: redundant pattern matching, consider using `is_some()`
23
- --> tests/ui/redundant_pattern_matching_option.rs:36 :12
23
+ --> tests/ui/redundant_pattern_matching_option.rs:35 :12
24
24
|
25
25
LL | if let Some(_) = Some(42) {}
26
26
| -------^^^^^^^----------- help: try: `if Some(42).is_some()`
27
27
28
28
error: redundant pattern matching, consider using `is_some()`
29
- --> tests/ui/redundant_pattern_matching_option.rs:39 :12
29
+ --> tests/ui/redundant_pattern_matching_option.rs:38 :12
30
30
|
31
31
LL | if let Some(_) = Some(42) {
32
32
| -------^^^^^^^----------- help: try: `if Some(42).is_some()`
33
33
34
34
error: redundant pattern matching, consider using `is_some()`
35
- --> tests/ui/redundant_pattern_matching_option.rs:46 :15
35
+ --> tests/ui/redundant_pattern_matching_option.rs:45 :15
36
36
|
37
37
LL | while let Some(_) = Some(42) {}
38
38
| ----------^^^^^^^----------- help: try: `while Some(42).is_some()`
39
39
40
40
error: redundant pattern matching, consider using `is_none()`
41
- --> tests/ui/redundant_pattern_matching_option.rs:49 :15
41
+ --> tests/ui/redundant_pattern_matching_option.rs:48 :15
42
42
|
43
43
LL | while let None = Some(42) {}
44
44
| ----------^^^^----------- help: try: `while Some(42).is_none()`
45
45
46
46
error: redundant pattern matching, consider using `is_none()`
47
- --> tests/ui/redundant_pattern_matching_option.rs:52 :15
47
+ --> tests/ui/redundant_pattern_matching_option.rs:51 :15
48
48
|
49
49
LL | while let None = None::<()> {}
50
50
| ----------^^^^------------- help: try: `while None::<()>.is_none()`
51
51
52
52
error: redundant pattern matching, consider using `is_some()`
53
- --> tests/ui/redundant_pattern_matching_option.rs:56 :15
53
+ --> tests/ui/redundant_pattern_matching_option.rs:55 :15
54
54
|
55
55
LL | while let Some(_) = v.pop() {
56
56
| ----------^^^^^^^---------- help: try: `while v.pop().is_some()`
57
57
58
58
error: redundant pattern matching, consider using `is_some()`
59
- --> tests/ui/redundant_pattern_matching_option.rs:65 :5
59
+ --> tests/ui/redundant_pattern_matching_option.rs:64 :5
60
60
|
61
61
LL | / match Some(42) {
62
62
LL | |
@@ -66,7 +66,7 @@ LL | | };
66
66
| |_____^ help: try: `Some(42).is_some()`
67
67
68
68
error: redundant pattern matching, consider using `is_none()`
69
- --> tests/ui/redundant_pattern_matching_option.rs:71 :5
69
+ --> tests/ui/redundant_pattern_matching_option.rs:70 :5
70
70
|
71
71
LL | / match None::<()> {
72
72
LL | |
@@ -76,7 +76,7 @@ LL | | };
76
76
| |_____^ help: try: `None::<()>.is_none()`
77
77
78
78
error: redundant pattern matching, consider using `is_none()`
79
- --> tests/ui/redundant_pattern_matching_option.rs:77 :13
79
+ --> tests/ui/redundant_pattern_matching_option.rs:76 :13
80
80
|
81
81
LL | let _ = match None::<()> {
82
82
| _____________^
@@ -87,55 +87,55 @@ LL | | };
87
87
| |_____^ help: try: `None::<()>.is_none()`
88
88
89
89
error: redundant pattern matching, consider using `is_some()`
90
- --> tests/ui/redundant_pattern_matching_option.rs:84 :20
90
+ --> tests/ui/redundant_pattern_matching_option.rs:83 :20
91
91
|
92
92
LL | let _ = if let Some(_) = opt { true } else { false };
93
93
| -------^^^^^^^------ help: try: `if opt.is_some()`
94
94
95
95
error: redundant pattern matching, consider using `is_some()`
96
- --> tests/ui/redundant_pattern_matching_option.rs:91 :20
96
+ --> tests/ui/redundant_pattern_matching_option.rs:90 :20
97
97
|
98
98
LL | let _ = if let Some(_) = gen_opt() {
99
99
| -------^^^^^^^------------ help: try: `if gen_opt().is_some()`
100
100
101
101
error: redundant pattern matching, consider using `is_none()`
102
- --> tests/ui/redundant_pattern_matching_option.rs:94 :19
102
+ --> tests/ui/redundant_pattern_matching_option.rs:93 :19
103
103
|
104
104
LL | } else if let None = gen_opt() {
105
105
| -------^^^^------------ help: try: `if gen_opt().is_none()`
106
106
107
107
error: redundant pattern matching, consider using `is_some()`
108
- --> tests/ui/redundant_pattern_matching_option.rs:101 :12
108
+ --> tests/ui/redundant_pattern_matching_option.rs:100 :12
109
109
|
110
110
LL | if let Some(..) = gen_opt() {}
111
111
| -------^^^^^^^^------------ help: try: `if gen_opt().is_some()`
112
112
113
113
error: redundant pattern matching, consider using `is_some()`
114
- --> tests/ui/redundant_pattern_matching_option.rs:117 :12
114
+ --> tests/ui/redundant_pattern_matching_option.rs:116 :12
115
115
|
116
116
LL | if let Some(_) = Some(42) {}
117
117
| -------^^^^^^^----------- help: try: `if Some(42).is_some()`
118
118
119
119
error: redundant pattern matching, consider using `is_none()`
120
- --> tests/ui/redundant_pattern_matching_option.rs:120 :12
120
+ --> tests/ui/redundant_pattern_matching_option.rs:119 :12
121
121
|
122
122
LL | if let None = None::<()> {}
123
123
| -------^^^^------------- help: try: `if None::<()>.is_none()`
124
124
125
125
error: redundant pattern matching, consider using `is_some()`
126
- --> tests/ui/redundant_pattern_matching_option.rs:123 :15
126
+ --> tests/ui/redundant_pattern_matching_option.rs:122 :15
127
127
|
128
128
LL | while let Some(_) = Some(42) {}
129
129
| ----------^^^^^^^----------- help: try: `while Some(42).is_some()`
130
130
131
131
error: redundant pattern matching, consider using `is_none()`
132
- --> tests/ui/redundant_pattern_matching_option.rs:126 :15
132
+ --> tests/ui/redundant_pattern_matching_option.rs:125 :15
133
133
|
134
134
LL | while let None = None::<()> {}
135
135
| ----------^^^^------------- help: try: `while None::<()>.is_none()`
136
136
137
137
error: redundant pattern matching, consider using `is_some()`
138
- --> tests/ui/redundant_pattern_matching_option.rs:129 :5
138
+ --> tests/ui/redundant_pattern_matching_option.rs:128 :5
139
139
|
140
140
LL | / match Some(42) {
141
141
LL | |
@@ -145,7 +145,7 @@ LL | | };
145
145
| |_____^ help: try: `Some(42).is_some()`
146
146
147
147
error: redundant pattern matching, consider using `is_none()`
148
- --> tests/ui/redundant_pattern_matching_option.rs:135 :5
148
+ --> tests/ui/redundant_pattern_matching_option.rs:134 :5
149
149
|
150
150
LL | / match None::<()> {
151
151
LL | |
@@ -155,19 +155,19 @@ LL | | };
155
155
| |_____^ help: try: `None::<()>.is_none()`
156
156
157
157
error: redundant pattern matching, consider using `is_none()`
158
- --> tests/ui/redundant_pattern_matching_option.rs:144 :12
158
+ --> tests/ui/redundant_pattern_matching_option.rs:143 :12
159
159
|
160
160
LL | if let None = *(&None::<()>) {}
161
161
| -------^^^^----------------- help: try: `if (&None::<()>).is_none()`
162
162
163
163
error: redundant pattern matching, consider using `is_none()`
164
- --> tests/ui/redundant_pattern_matching_option.rs:146 :12
164
+ --> tests/ui/redundant_pattern_matching_option.rs:145 :12
165
165
|
166
166
LL | if let None = *&None::<()> {}
167
167
| -------^^^^--------------- help: try: `if (&None::<()>).is_none()`
168
168
169
169
error: redundant pattern matching, consider using `is_some()`
170
- --> tests/ui/redundant_pattern_matching_option.rs:153 :5
170
+ --> tests/ui/redundant_pattern_matching_option.rs:152 :5
171
171
|
172
172
LL | / match x {
173
173
LL | |
@@ -177,7 +177,7 @@ LL | | };
177
177
| |_____^ help: try: `x.is_some()`
178
178
179
179
error: redundant pattern matching, consider using `is_none()`
180
- --> tests/ui/redundant_pattern_matching_option.rs:159 :5
180
+ --> tests/ui/redundant_pattern_matching_option.rs:158 :5
181
181
|
182
182
LL | / match x {
183
183
LL | |
@@ -187,7 +187,7 @@ LL | | };
187
187
| |_____^ help: try: `x.is_none()`
188
188
189
189
error: redundant pattern matching, consider using `is_none()`
190
- --> tests/ui/redundant_pattern_matching_option.rs:165 :5
190
+ --> tests/ui/redundant_pattern_matching_option.rs:164 :5
191
191
|
192
192
LL | / match x {
193
193
LL | |
@@ -197,7 +197,7 @@ LL | | };
197
197
| |_____^ help: try: `x.is_none()`
198
198
199
199
error: redundant pattern matching, consider using `is_some()`
200
- --> tests/ui/redundant_pattern_matching_option.rs:171 :5
200
+ --> tests/ui/redundant_pattern_matching_option.rs:170 :5
201
201
|
202
202
LL | / match x {
203
203
LL | |
@@ -207,19 +207,19 @@ LL | | };
207
207
| |_____^ help: try: `x.is_some()`
208
208
209
209
error: redundant pattern matching, consider using `is_some()`
210
- --> tests/ui/redundant_pattern_matching_option.rs:187 :13
210
+ --> tests/ui/redundant_pattern_matching_option.rs:186 :13
211
211
|
212
212
LL | let _ = matches!(x, Some(_));
213
213
| ^^^^^^^^^^^^^^^^^^^^ help: try: `x.is_some()`
214
214
215
215
error: redundant pattern matching, consider using `is_none()`
216
- --> tests/ui/redundant_pattern_matching_option.rs:190 :13
216
+ --> tests/ui/redundant_pattern_matching_option.rs:189 :13
217
217
|
218
218
LL | let _ = matches!(x, None);
219
219
| ^^^^^^^^^^^^^^^^^ help: try: `x.is_none()`
220
220
221
221
error: redundant pattern matching, consider using `is_none()`
222
- --> tests/ui/redundant_pattern_matching_option.rs:201 :17
222
+ --> tests/ui/redundant_pattern_matching_option.rs:200 :17
223
223
|
224
224
LL | let _ = matches!(*p, None);
225
225
| ^^^^^^^^^^^^^^^^^^ help: try: `(*p).is_none()`
0 commit comments