mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-24 21:53:23 +00:00
20 lines
691 B
Text
20 lines
691 B
Text
error: using `Option.and_then(Some)`, which is a no-op
|
|
--> $DIR/option_and_then_some.rs:8:13
|
|
|
|
|
LL | let _ = x.and_then(Some);
|
|
| ^^^^^^^^^^^^^^^^ help: use the expression directly: `x`
|
|
|
|
|
note: the lint level is defined here
|
|
--> $DIR/option_and_then_some.rs:2:9
|
|
|
|
|
LL | #![deny(clippy::option_and_then_some)]
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)`
|
|
--> $DIR/option_and_then_some.rs:9:13
|
|
|
|
|
LL | let _ = x.and_then(|o| Some(o + 1));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `x.map(|o| o + 1)`
|
|
|
|
error: aborting due to 2 previous errors
|
|
|