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