Much more flow control destructuring in RBE
This commit is contained in:
9
rustbyexample/flow_control.d/match.d/guard2.rs
Normal file
9
rustbyexample/flow_control.d/match.d/guard2.rs
Normal file
@@ -0,0 +1,9 @@
|
||||
fn main() {
|
||||
let number: u8 = 4;
|
||||
|
||||
match number {
|
||||
i if i == 0 => println!("Zero"),
|
||||
i if i > 0 => println!("Greater than zero"),
|
||||
_ => unreachable!("Should never happen."),
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user