2021-11-13 13:38:28 +00:00
|
|
|
error: called `map_or(None, ..)` on an `Option` value. This can be done more directly by calling `map(..)` instead
|
2019-08-16 02:42:07 +00:00
|
|
|
--> $DIR/option_map_or_none.rs:10:13
|
2019-04-18 06:12:59 +00:00
|
|
|
|
|
|
|
|
LL | let _ = opt.map_or(None, |x| Some(x + 1));
|
2021-11-13 13:38:28 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using `map` instead: `opt.map(|x| Some(x + 1))`
|
2019-04-18 06:12:59 +00:00
|
|
|
|
|
|
|
|
= note: `-D clippy::option-map-or-none` implied by `-D warnings`
|
|
|
|
|
2021-11-13 13:38:28 +00:00
|
|
|
error: called `map_or(None, ..)` on an `Option` value. This can be done more directly by calling `map(..)` instead
|
2019-08-16 02:42:07 +00:00
|
|
|
--> $DIR/option_map_or_none.rs:13:13
|
2019-04-18 06:12:59 +00:00
|
|
|
|
|
|
|
|
LL | let _ = opt.map_or(None, |x| {
|
|
|
|
| _____________^
|
|
|
|
LL | | Some(x + 1)
|
|
|
|
LL | | });
|
|
|
|
| |_________________________^
|
2019-10-26 19:53:42 +00:00
|
|
|
|
|
2021-11-13 13:38:28 +00:00
|
|
|
help: try using `map` instead
|
2019-04-18 06:12:59 +00:00
|
|
|
|
|
2021-11-13 13:38:28 +00:00
|
|
|
LL ~ let _ = opt.map(|x| {
|
2021-08-11 14:21:33 +00:00
|
|
|
LL + Some(x + 1)
|
|
|
|
LL ~ });
|
2019-04-18 06:12:59 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
error: aborting due to 2 previous errors
|
|
|
|
|