Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. enum Foo {
  2. Bar,
  3. Baz {b: bool, x: u8, y: u8},
  4. }
  5.  
  6. fn main () {
  7. let x = Foo::Baz{x: 3, y: 1,b: true };
  8. match x {
  9. Foo::Bar => println!("Nope"),
  10. Foo::Baz{b: true, ..} => println!("It's TRUE!"),
  11. Foo::Baz{x, ..} => println!("Yep {}", x),
  12. }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement