2023-11-23 06:30:36 -06:00
|
|
|
error: called `map(<f>).unwrap_or_else(<g>)` on an `Option` value
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/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-11-23 06:30:36 -06:00
|
|
|
error: called `map(<f>).unwrap_or_else(<g>)` on a `Result` value
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/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
|
|
|
|
|