2020-11-23 06:51:04 -06:00
|
|
|
error: unnecessary closure used to substitute value for `Result::Err`
|
|
|
|
--> $DIR/unnecessary_lazy_eval_unfixable.rs:12:13
|
|
|
|
|
|
|
|
|
LL | let _ = Ok(1).unwrap_or_else(|()| 2);
|
2022-03-24 08:50:04 -05:00
|
|
|
| ^^^^^^----------------------
|
|
|
|
| |
|
|
|
|
| help: use `unwrap_or(..)` instead: `unwrap_or(2)`
|
2020-11-23 06:51:04 -06:00
|
|
|
|
|
|
|
|
= note: `-D clippy::unnecessary-lazy-evaluations` implied by `-D warnings`
|
|
|
|
|
|
|
|
error: unnecessary closure used to substitute value for `Result::Err`
|
|
|
|
--> $DIR/unnecessary_lazy_eval_unfixable.rs:16:13
|
|
|
|
|
|
|
|
|
LL | let _ = Ok(1).unwrap_or_else(|e::E| 2);
|
2022-03-24 08:50:04 -05:00
|
|
|
| ^^^^^^------------------------
|
|
|
|
| |
|
|
|
|
| help: use `unwrap_or(..)` instead: `unwrap_or(2)`
|
2020-11-23 06:51:04 -06:00
|
|
|
|
|
|
|
error: unnecessary closure used to substitute value for `Result::Err`
|
|
|
|
--> $DIR/unnecessary_lazy_eval_unfixable.rs:17:13
|
|
|
|
|
|
|
|
|
LL | let _ = Ok(1).unwrap_or_else(|SomeStruct { .. }| 2);
|
2022-03-24 08:50:04 -05:00
|
|
|
| ^^^^^^-------------------------------------
|
|
|
|
| |
|
|
|
|
| help: use `unwrap_or(..)` instead: `unwrap_or(2)`
|
2020-11-23 06:51:04 -06:00
|
|
|
|
|
|
|
error: aborting due to 3 previous errors
|
|
|
|
|