Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- enum Color {
- Red,
- Green,
- Blue,
- }
- fn foo() {
- let my_box = Box::new(Color::Red);
- match *my_box {
- Color::Red => println!("Red box!"),
- Color::Green => println!("Green box!"),
- Color::Blue => println!("Blue box!"),
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement