rust/tests/ui-toml/manual_let_else/manual_let_else.rs

15 lines
228 B
Rust
Raw Normal View History

2023-09-24 07:56:40 -05:00
#![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,
};
}