2023-12-01 11:21:58 -06:00
|
|
|
error: called `map(<f>).unwrap_or_else(<g>)` on an `Option` value
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/map_unwrap_or_fixable.rs:16:13
|
2020-11-05 07:29:48 -06:00
|
|
|
|
|
|
|
|
LL | let _ = opt.map(|x| x + 1)
|
|
|
|
| _____________^
|
|
|
|
LL | | // Should lint even though this call is on a separate line.
|
|
|
|
LL | | .unwrap_or_else(|| 0);
|
2023-07-17 03:19:29 -05:00
|
|
|
| |_____________________________^ help: try: `opt.map_or_else(|| 0, |x| x + 1)`
|
2020-11-05 07:29:48 -06:00
|
|
|
|
|
|
|
|
= note: `-D clippy::map-unwrap-or` implied by `-D warnings`
|
2023-08-01 07:02:21 -05:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::map_unwrap_or)]`
|
2020-11-05 07:29:48 -06:00
|
|
|
|
2023-12-01 11:21:58 -06:00
|
|
|
error: called `map(<f>).unwrap_or_else(<g>)` on a `Result` value
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/map_unwrap_or_fixable.rs:46:13
|
2020-11-05 07:29:48 -06:00
|
|
|
|
|
|
|
|
LL | let _ = res.map(|x| x + 1)
|
|
|
|
| _____________^
|
|
|
|
LL | | // should lint even though this call is on a separate line
|
|
|
|
LL | | .unwrap_or_else(|_e| 0);
|
2023-07-17 03:19:29 -05:00
|
|
|
| |_______________________________^ help: try: `res.map_or_else(|_e| 0, |x| x + 1)`
|
2020-11-05 07:29:48 -06:00
|
|
|
|
|
|
|
error: aborting due to 2 previous errors
|
|
|
|
|