Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct Guard(i32);
- fn main() {
- let guard = Guard(5);
- let result = match guard.0 {
- x if x == 0 => "equal",
- x if x < 0 => "less",
- x if x > 0 => "greater",
- _ => "unreachable"
- };
- println!("{}", result);
- }
Add Comment
Please, Sign In to add comment