Flow control match binding in RBE
This commit is contained in:
11
rustbyexample/flow_control.d/match.d/binding2.rs
Normal file
11
rustbyexample/flow_control.d/match.d/binding2.rs
Normal file
@@ -0,0 +1,11 @@
|
||||
fn some_number() -> Option<u32> {
|
||||
Some(42)
|
||||
}
|
||||
|
||||
fn main() {
|
||||
match some_number() {
|
||||
Some(n @ 42) => println!("The Answer: {}!", n),
|
||||
Some(n) => println!("Not interesting... {}", n),
|
||||
_ => (),
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user