@@ -318,37 +318,13 @@ error: unnecessary structure name repetition
318
318
263 | fn new() -> Foo { Foo }
319
319
| ^^^ help: use the applicable keyword: `Self`
320
320
321
- error: use of `unwrap_or` followed by a function call
322
- --> $DIR/methods.rs:281:5
323
- |
324
- 281 | with_constructor.unwrap_or(make());
325
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `with_constructor.unwrap_or_else(make)`
326
- |
327
- = note: `-D or-fun-call` implied by `-D warnings`
328
-
329
321
error: use of `unwrap_or` followed by a call to `new`
330
322
--> $DIR/methods.rs:284:5
331
323
|
332
324
284 | with_new.unwrap_or(Vec::new());
333
325
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `with_new.unwrap_or_default()`
334
-
335
- error: use of `unwrap_or` followed by a function call
336
- --> $DIR/methods.rs:287:5
337
326
|
338
- 287 | with_const_args.unwrap_or(Vec::with_capacity(12));
339
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `with_const_args.unwrap_or_else(|| Vec::with_capacity(12))`
340
-
341
- error: use of `unwrap_or` followed by a function call
342
- --> $DIR/methods.rs:290:5
343
- |
344
- 290 | with_err.unwrap_or(make());
345
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `with_err.unwrap_or_else(|_| make())`
346
-
347
- error: use of `unwrap_or` followed by a function call
348
- --> $DIR/methods.rs:293:5
349
- |
350
- 293 | with_err_args.unwrap_or(Vec::with_capacity(12));
351
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `with_err_args.unwrap_or_else(|_| Vec::with_capacity(12))`
327
+ = note: `-D or-fun-call` implied by `-D warnings`
352
328
353
329
error: use of `unwrap_or` followed by a call to `default`
354
330
--> $DIR/methods.rs:296:5
@@ -362,36 +338,6 @@ error: use of `unwrap_or` followed by a call to `default`
362
338
299 | with_default_type.unwrap_or(u64::default());
363
339
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `with_default_type.unwrap_or_default()`
364
340
365
- error: use of `unwrap_or` followed by a function call
366
- --> $DIR/methods.rs:302:5
367
- |
368
- 302 | with_vec.unwrap_or(vec![]);
369
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `with_vec.unwrap_or_else(|| < [ _ ] > :: into_vec ( box [ $ ( $ x ) , * ] ))`
370
-
371
- error: use of `unwrap_or` followed by a function call
372
- --> $DIR/methods.rs:307:5
373
- |
374
- 307 | without_default.unwrap_or(Foo::new());
375
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `without_default.unwrap_or_else(Foo::new)`
376
-
377
- error: use of `or_insert` followed by a function call
378
- --> $DIR/methods.rs:310:5
379
- |
380
- 310 | map.entry(42).or_insert(String::new());
381
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `map.entry(42).or_insert_with(String::new)`
382
-
383
- error: use of `or_insert` followed by a function call
384
- --> $DIR/methods.rs:313:5
385
- |
386
- 313 | btree.entry(42).or_insert(String::new());
387
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `btree.entry(42).or_insert_with(String::new)`
388
-
389
- error: use of `unwrap_or` followed by a function call
390
- --> $DIR/methods.rs:316:13
391
- |
392
- 316 | let _ = stringy.unwrap_or("".to_owned());
393
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `stringy.unwrap_or_else(|| "".to_owned())`
394
-
395
341
error: called `.iter().nth()` on a Vec. Calling `.get()` is both faster and more readable
396
342
--> $DIR/methods.rs:327:23
397
343
|
0 commit comments