@@ -149,79 +149,103 @@ LL | let x = if let Some(_) = opt { true } else { false };
149
149
| -------^^^^^^^------ help: try this: `if opt.is_some()`
150
150
151
151
error: redundant pattern matching, consider using `is_some()`
152
- --> $DIR/redundant_pattern_matching.rs:103 :20
152
+ --> $DIR/redundant_pattern_matching.rs:102 :20
153
153
|
154
154
LL | let _ = if let Some(_) = gen_opt() {
155
155
| -------^^^^^^^------------ help: try this: `if gen_opt().is_some()`
156
156
157
157
error: redundant pattern matching, consider using `is_none()`
158
- --> $DIR/redundant_pattern_matching.rs:105 :19
158
+ --> $DIR/redundant_pattern_matching.rs:104 :19
159
159
|
160
160
LL | } else if let None = gen_opt() {
161
161
| -------^^^^------------ help: try this: `if gen_opt().is_none()`
162
162
163
163
error: redundant pattern matching, consider using `is_ok()`
164
- --> $DIR/redundant_pattern_matching.rs:107 :19
164
+ --> $DIR/redundant_pattern_matching.rs:106 :19
165
165
|
166
166
LL | } else if let Ok(_) = gen_res() {
167
167
| -------^^^^^------------ help: try this: `if gen_res().is_ok()`
168
168
169
169
error: redundant pattern matching, consider using `is_err()`
170
- --> $DIR/redundant_pattern_matching.rs:109 :19
170
+ --> $DIR/redundant_pattern_matching.rs:108 :19
171
171
|
172
172
LL | } else if let Err(_) = gen_res() {
173
173
| -------^^^^^^------------ help: try this: `if gen_res().is_err()`
174
174
175
175
error: redundant pattern matching, consider using `is_some()`
176
- --> $DIR/redundant_pattern_matching.rs:142 :19
176
+ --> $DIR/redundant_pattern_matching.rs:141 :19
177
177
|
178
178
LL | while let Some(_) = r#try!(result_opt()) {}
179
179
| ----------^^^^^^^----------------------- help: try this: `while r#try!(result_opt()).is_some()`
180
180
181
181
error: redundant pattern matching, consider using `is_some()`
182
- --> $DIR/redundant_pattern_matching.rs:143 :16
182
+ --> $DIR/redundant_pattern_matching.rs:142 :16
183
183
|
184
184
LL | if let Some(_) = r#try!(result_opt()) {}
185
185
| -------^^^^^^^----------------------- help: try this: `if r#try!(result_opt()).is_some()`
186
186
187
187
error: redundant pattern matching, consider using `is_some()`
188
- --> $DIR/redundant_pattern_matching.rs:149 :12
188
+ --> $DIR/redundant_pattern_matching.rs:148 :12
189
189
|
190
190
LL | if let Some(_) = m!() {}
191
191
| -------^^^^^^^------- help: try this: `if m!().is_some()`
192
192
193
193
error: redundant pattern matching, consider using `is_some()`
194
- --> $DIR/redundant_pattern_matching.rs:150 :15
194
+ --> $DIR/redundant_pattern_matching.rs:149 :15
195
195
|
196
196
LL | while let Some(_) = m!() {}
197
197
| ----------^^^^^^^------- help: try this: `while m!().is_some()`
198
198
199
199
error: redundant pattern matching, consider using `is_ok()`
200
- --> $DIR/redundant_pattern_matching.rs:179 :12
200
+ --> $DIR/redundant_pattern_matching.rs:156 :12
201
201
|
202
202
LL | if let Ok(_) = Ok::<i32, i32>(42) {}
203
203
| -------^^^^^--------------------- help: try this: `if Ok::<i32, i32>(42).is_ok()`
204
204
205
205
error: redundant pattern matching, consider using `is_err()`
206
- --> $DIR/redundant_pattern_matching.rs:181 :12
206
+ --> $DIR/redundant_pattern_matching.rs:158 :12
207
207
|
208
208
LL | if let Err(_) = Err::<i32, i32>(42) {}
209
209
| -------^^^^^^---------------------- help: try this: `if Err::<i32, i32>(42).is_err()`
210
210
211
+ error: redundant pattern matching, consider using `is_some()`
212
+ --> $DIR/redundant_pattern_matching.rs:160:12
213
+ |
214
+ LL | if let Some(_) = Some(42) {}
215
+ | -------^^^^^^^----------- help: try this: `if Some(42).is_some()`
216
+
217
+ error: redundant pattern matching, consider using `is_none()`
218
+ --> $DIR/redundant_pattern_matching.rs:162:12
219
+ |
220
+ LL | if let None = None::<()> {}
221
+ | -------^^^^------------- help: try this: `if None::<()>.is_none()`
222
+
211
223
error: redundant pattern matching, consider using `is_ok()`
212
- --> $DIR/redundant_pattern_matching.rs:183 :15
224
+ --> $DIR/redundant_pattern_matching.rs:164 :15
213
225
|
214
226
LL | while let Ok(_) = Ok::<i32, i32>(10) {}
215
227
| ----------^^^^^--------------------- help: try this: `while Ok::<i32, i32>(10).is_ok()`
216
228
217
229
error: redundant pattern matching, consider using `is_err()`
218
- --> $DIR/redundant_pattern_matching.rs:185 :15
230
+ --> $DIR/redundant_pattern_matching.rs:166 :15
219
231
|
220
232
LL | while let Err(_) = Ok::<i32, i32>(10) {}
221
233
| ----------^^^^^^--------------------- help: try this: `while Ok::<i32, i32>(10).is_err()`
222
234
235
+ error: redundant pattern matching, consider using `is_some()`
236
+ --> $DIR/redundant_pattern_matching.rs:168:15
237
+ |
238
+ LL | while let Some(_) = Some(42) {}
239
+ | ----------^^^^^^^----------- help: try this: `while Some(42).is_some()`
240
+
241
+ error: redundant pattern matching, consider using `is_none()`
242
+ --> $DIR/redundant_pattern_matching.rs:170:15
243
+ |
244
+ LL | while let None = None::<()> {}
245
+ | ----------^^^^------------- help: try this: `while None::<()>.is_none()`
246
+
223
247
error: redundant pattern matching, consider using `is_ok()`
224
- --> $DIR/redundant_pattern_matching.rs:187 :5
248
+ --> $DIR/redundant_pattern_matching.rs:172 :5
225
249
|
226
250
LL | / match Ok::<i32, i32>(42) {
227
251
LL | | Ok(_) => true,
@@ -230,13 +254,31 @@ LL | | };
230
254
| |_____^ help: try this: `Ok::<i32, i32>(42).is_ok()`
231
255
232
256
error: redundant pattern matching, consider using `is_err()`
233
- --> $DIR/redundant_pattern_matching.rs:192 :5
257
+ --> $DIR/redundant_pattern_matching.rs:177 :5
234
258
|
235
259
LL | / match Err::<i32, i32>(42) {
236
260
LL | | Ok(_) => false,
237
261
LL | | Err(_) => true,
238
262
LL | | };
239
263
| |_____^ help: try this: `Err::<i32, i32>(42).is_err()`
240
264
241
- error: aborting due to 35 previous errors
265
+ error: redundant pattern matching, consider using `is_some()`
266
+ --> $DIR/redundant_pattern_matching.rs:182:5
267
+ |
268
+ LL | / match Some(42) {
269
+ LL | | Some(_) => true,
270
+ LL | | None => false,
271
+ LL | | };
272
+ | |_____^ help: try this: `Some(42).is_some()`
273
+
274
+ error: redundant pattern matching, consider using `is_none()`
275
+ --> $DIR/redundant_pattern_matching.rs:187:5
276
+ |
277
+ LL | / match None::<()> {
278
+ LL | | Some(_) => false,
279
+ LL | | None => true,
280
+ LL | | };
281
+ | |_____^ help: try this: `None::<()>.is_none()`
282
+
283
+ error: aborting due to 41 previous errors
242
284
0 commit comments