]> git.lizzy.rs Git - rust.git/blob - tests/ui/option_and_then_some.stderr
Auto merge of #5522 - CrazyRoka:match_vec_item, r=phansch
[rust.git] / tests / ui / option_and_then_some.stderr
1 error: using `Option.and_then(Some)`, which is a no-op
2   --> $DIR/option_and_then_some.rs:8:13
3    |
4 LL |     let _ = x.and_then(Some);
5    |             ^^^^^^^^^^^^^^^^ help: use the expression directly: `x`
6    |
7 note: the lint level is defined here
8   --> $DIR/option_and_then_some.rs:2:9
9    |
10 LL | #![deny(clippy::option_and_then_some)]
11    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12
13 error: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)`
14   --> $DIR/option_and_then_some.rs:9:13
15    |
16 LL |     let _ = x.and_then(|o| Some(o + 1));
17    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `x.map(|o| o + 1)`
18
19 error: aborting due to 2 previous errors
20