2020-11-23 06:51:04 -06:00
|
|
|
error: unnecessary closure used to substitute value for `Result::Err`
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/unnecessary_lazy_eval_unfixable.rs:13:13
|
2020-11-23 06:51:04 -06:00
|
|
|
|
|
|
|
|
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`
|
2023-08-01 07:02:21 -05:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::unnecessary_lazy_evaluations)]`
|
2020-11-23 06:51:04 -06:00
|
|
|
|
|
|
|
error: unnecessary closure used to substitute value for `Result::Err`
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/unnecessary_lazy_eval_unfixable.rs:19:13
|
2020-11-23 06:51:04 -06:00
|
|
|
|
|
|
|
|
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`
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/unnecessary_lazy_eval_unfixable.rs:21:13
|
2020-11-23 06:51:04 -06:00
|
|
|
|
|
|
|
|
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
|
|
|
|
2023-10-15 17:29:28 -05:00
|
|
|
error: unnecessary closure used with `bool::then`
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/unnecessary_lazy_eval_unfixable.rs:31:13
|
2023-10-15 17:29:28 -05:00
|
|
|
|
|
|
|
|
LL | let _ = true.then(|| -> &[u8] { &[] });
|
|
|
|
| ^^^^^-------------------------
|
|
|
|
| |
|
|
|
|
| help: use `then_some(..)` instead: `then_some({ &[] })`
|
|
|
|
|
|
|
|
error: aborting due to 4 previous errors
|
2020-11-23 06:51:04 -06:00
|
|
|
|