Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- enum Foo {
- Bar,
- Baz {b: bool, x: u8, y: u8},
- }
- fn main () {
- let x = Foo::Baz{x: 3, y: 1,b: true };
- match x {
- Foo::Bar => println!("Nope"),
- Foo::Baz{b: true, ..} => println!("It's TRUE!"),
- Foo::Baz{x, ..} => println!("Yep {}", x),
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement