Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- enum Example {
- One,
- Two,
- Three
- }
- fn main() {
- let e1 = Example::One;
- let v1 = match e1 {
- Example::One => 1,
- Example::Two => 2,
- Example::Three => 3,
- };
- let e2 = Example::Three;
- let v2 = match e2 {
- Example::Two => 2,
- _ => 99,
- };
- print!("{} + {} = {}", v1, v2, v1 + v2);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement