mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-24 20:13:24 +00:00
c2c73189c8
Co-authored-by: Adrian <adrian.iosdev@gmail.com>
15 lines
480 B
Text
15 lines
480 B
Text
error: this could be rewritten as `let...else`
|
|
--> $DIR/manual_let_else.rs:9:5
|
|
|
|
|
LL | / let x = match Foo::A(1) {
|
|
LL | |
|
|
LL | | Foo::A(x) => x,
|
|
LL | | Foo::B => return,
|
|
LL | | };
|
|
| |______^ help: consider writing: `let Foo::A(x) = Foo::A(1) else { return };`
|
|
|
|
|
= note: `-D clippy::manual-let-else` implied by `-D warnings`
|
|
= help: to override `-D warnings` add `#[allow(clippy::manual_let_else)]`
|
|
|
|
error: aborting due to 1 previous error
|
|
|