Skip to content

Instantly share code, notes, and snippets.

@saml
Created February 14, 2014 19:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saml/9007581 to your computer and use it in GitHub Desktop.
Save saml/9007581 to your computer and use it in GitHub Desktop.
//this is good
fn main() {
let x:uint = 2;
let msg = match x {
0 => "zero",
1 | 2 => "haha",
1..2 => "hehe",
_ => "#yolo"
};
println!("{}", msg);
}
//this is compiler error
fn main() {
let x:uint = 2;
let msg = match x {
0 => "zero",
1..2 => "hehe",
1 | 2 => "haha",
_ => "#yolo"
};
println!("{}", msg);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment