Advertisement
Guest User

Untitled

a guest
Apr 19th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. enum Color {
  2. Red,
  3. Green,
  4. Blue,
  5. }
  6.  
  7. fn foo() {
  8. let my_box = Box::new(Color::Red);
  9.  
  10. match *my_box {
  11. Color::Red => println!("Red box!"),
  12. Color::Green => println!("Green box!"),
  13. Color::Blue => println!("Blue box!"),
  14. }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement