mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-23 19:43:20 +00:00
15 lines
228 B
Rust
15 lines
228 B
Rust
|
#![warn(clippy::manual_let_else)]
|
||
|
|
||
|
enum Foo {
|
||
|
A(u8),
|
||
|
B,
|
||
|
}
|
||
|
|
||
|
fn main() {
|
||
|
let x = match Foo::A(1) {
|
||
|
//~^ ERROR: this could be rewritten as `let...else`
|
||
|
Foo::A(x) => x,
|
||
|
Foo::B => return,
|
||
|
};
|
||
|
}
|