mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-30 16:39:26 +00:00
28 lines
1.1 KiB
Text
28 lines
1.1 KiB
Text
error: unnecessary closure used to substitute value for `Result::Err`
|
|
--> $DIR/unnecessary_lazy_eval_unfixable.rs:13:13
|
|
|
|
|
LL | let _ = Ok(1).unwrap_or_else(|()| 2);
|
|
| ^^^^^^----------------------
|
|
| |
|
|
| help: use `unwrap_or(..)` instead: `unwrap_or(2)`
|
|
|
|
|
= 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:19:13
|
|
|
|
|
LL | let _ = Ok(1).unwrap_or_else(|e::E| 2);
|
|
| ^^^^^^------------------------
|
|
| |
|
|
| help: use `unwrap_or(..)` instead: `unwrap_or(2)`
|
|
|
|
error: unnecessary closure used to substitute value for `Result::Err`
|
|
--> $DIR/unnecessary_lazy_eval_unfixable.rs:21:13
|
|
|
|
|
LL | let _ = Ok(1).unwrap_or_else(|SomeStruct { .. }| 2);
|
|
| ^^^^^^-------------------------------------
|
|
| |
|
|
| help: use `unwrap_or(..)` instead: `unwrap_or(2)`
|
|
|
|
error: aborting due to 3 previous errors
|
|
|