2021-11-13 07:38:28 -06:00
|
|
|
error: called `map_or(None, ..)` on an `Option` value. This can be done more directly by calling `map(..)` instead
|
2021-11-15 11:06:31 -06:00
|
|
|
--> $DIR/option_map_or_none.rs:13:26
|
2019-04-18 01:12:59 -05:00
|
|
|
|
|
2021-11-15 00:47:57 -06:00
|
|
|
LL | let _ :Option<i32> = opt.map_or(None, |x| Some(x + 1));
|
2021-11-15 11:06:31 -06:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using `map` instead: `opt.map(|x| x + 1)`
|
2019-04-18 01:12:59 -05:00
|
|
|
|
|
|
|
|
= note: `-D clippy::option-map-or-none` implied by `-D warnings`
|
|
|
|
|
2021-11-13 07:38:28 -06:00
|
|
|
error: called `map_or(None, ..)` on an `Option` value. This can be done more directly by calling `map(..)` instead
|
2021-11-15 11:06:31 -06:00
|
|
|
--> $DIR/option_map_or_none.rs:16:26
|
2019-04-18 01:12:59 -05:00
|
|
|
|
|
2021-11-15 00:47:57 -06:00
|
|
|
LL | let _ :Option<i32> = opt.map_or(None, |x| {
|
2021-11-15 11:06:31 -06:00
|
|
|
| __________________________^
|
2019-04-18 01:12:59 -05:00
|
|
|
LL | | Some(x + 1)
|
|
|
|
LL | | });
|
2021-11-15 11:29:02 -06:00
|
|
|
| |_________________________^ help: try using `map` instead: `opt.map(|x| x + 1)`
|
2019-04-18 01:12:59 -05:00
|
|
|
|
2021-11-15 11:06:31 -06:00
|
|
|
error: called `map_or(None, ..)` on an `Option` value. This can be done more directly by calling `and_then(..)` instead
|
2021-11-15 00:47:57 -06:00
|
|
|
--> $DIR/option_map_or_none.rs:20:26
|
|
|
|
|
|
|
|
|
LL | let _ :Option<i32> = opt.map_or(None, bar);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try using `and_then` instead: `opt.and_then(bar)`
|
|
|
|
|
|
|
|
error: aborting due to 3 previous errors
|
2019-04-18 01:12:59 -05:00
|
|
|
|