2023-11-23 12:30:36 +00:00
|
|
|
error: called `map(<f>).unwrap_or_else(<g>)` on an `Option` value
|
2023-08-24 19:32:12 +00:00
|
|
|
--> $DIR/map_unwrap_or_fixable.rs:16:13
|
2020-11-05 13:29:48 +00: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 08:19:29 +00:00
|
|
|
| |_____________________________^ help: try: `opt.map_or_else(|| 0, |x| x + 1)`
|
2020-11-05 13:29:48 +00:00
|
|
|
|
|
|
|
|
= note: `-D clippy::map-unwrap-or` implied by `-D warnings`
|
2023-08-01 12:02:21 +00:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::map_unwrap_or)]`
|
2020-11-05 13:29:48 +00:00
|
|
|
|
2023-11-23 12:30:36 +00:00
|
|
|
error: called `map(<f>).unwrap_or_else(<g>)` on a `Result` value
|
2023-08-24 19:32:12 +00:00
|
|
|
--> $DIR/map_unwrap_or_fixable.rs:46:13
|
2020-11-05 13:29:48 +00: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 08:19:29 +00:00
|
|
|
| |_______________________________^ help: try: `res.map_or_else(|_e| 0, |x| x + 1)`
|
2020-11-05 13:29:48 +00:00
|
|
|
|
|
|
|
error: aborting due to 2 previous errors
|
|
|
|
|