Created
September 6, 2018 15:37
-
-
Save ananthp/9bdb1516a0fcc77413da47538f132389 to your computer and use it in GitHub Desktop.
Rust Experiments
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn main() { | |
let a = 12; | |
let message = match a { // what if multiple arms can be matched? | |
0 => "zero", | |
1...5 => "one to five", | |
x if x > 10 => ">10", | |
x if x < 20 => "<20", | |
_ =>"n/a" | |
}; | |
println!("{}", message) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment