]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/option_map_or_none.stderr
Rollup merge of #78769 - est31:remove_lifetimes, r=KodrAus
[rust.git] / src / tools / clippy / tests / ui / option_map_or_none.stderr
1 error: called `map_or(None, ..)` on an `Option` value. This can be done more directly by calling `and_then(..)` instead
2   --> $DIR/option_map_or_none.rs:10:13
3    |
4 LL |     let _ = opt.map_or(None, |x| Some(x + 1));
5    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using `and_then` instead: `opt.and_then(|x| Some(x + 1))`
6    |
7    = note: `-D clippy::option-map-or-none` implied by `-D warnings`
8
9 error: called `map_or(None, ..)` on an `Option` value. This can be done more directly by calling `and_then(..)` instead
10   --> $DIR/option_map_or_none.rs:13:13
11    |
12 LL |       let _ = opt.map_or(None, |x| {
13    |  _____________^
14 LL | |                         Some(x + 1)
15 LL | |                        });
16    | |_________________________^
17    |
18 help: try using `and_then` instead
19    |
20 LL |     let _ = opt.and_then(|x| {
21 LL |                         Some(x + 1)
22 LL |                        });
23    |
24
25 error: aborting due to 2 previous errors
26