2024-01-18 10:59:14 -06:00
|
|
|
error: unused "map closure" when calling `Result::map_or_else` value
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/unnecessary_result_map_or_else.rs:6:5
|
2024-01-18 10:59:14 -06:00
|
|
|
|
|
|
|
|
LL | x.map_or_else(|err| err, |n| n);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `unwrap_or_else`: `x.unwrap_or_else(|err| err)`
|
|
|
|
|
|
|
|
|
= note: `-D clippy::unnecessary-result-map-or-else` implied by `-D warnings`
|
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::unnecessary_result_map_or_else)]`
|
|
|
|
|
|
|
|
error: unused "map closure" when calling `Result::map_or_else` value
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/unnecessary_result_map_or_else.rs:10:5
|
2024-01-18 10:59:14 -06:00
|
|
|
|
|
|
|
|
LL | x.map_or_else(|err: ()| err, |n: ()| n);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `unwrap_or_else`: `x.unwrap_or_else(|err: ()| err)`
|
|
|
|
|
|
|
|
error: unused "map closure" when calling `Result::map_or_else` value
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/unnecessary_result_map_or_else.rs:15:19
|
2024-01-18 10:59:14 -06:00
|
|
|
|
|
|
|
|
LL | let y: &str = x.map_or_else(|err| err, |n| n);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `unwrap_or_else`: `x.unwrap_or_else(|err| err)`
|
|
|
|
|
|
|
|
error: unused "map closure" when calling `Result::map_or_else` value
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/unnecessary_result_map_or_else.rs:19:5
|
2024-01-18 10:59:14 -06:00
|
|
|
|
|
|
|
|
LL | / x.map_or_else(
|
|
|
|
LL | |
|
|
|
|
LL | | |err| err,
|
|
|
|
LL | | |n| {
|
|
|
|
... |
|
|
|
|
LL | | },
|
|
|
|
LL | | );
|
|
|
|
| |_____^ help: consider using `unwrap_or_else`: `x.unwrap_or_else(|err| err)`
|
|
|
|
|
|
|
|
error: aborting due to 4 previous errors
|
|
|
|
|