Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@rust-play
Created April 23, 2019 05:26
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 rust-play/d04885fc4aab9f77c0079dead750c746 to your computer and use it in GitHub Desktop.
Save rust-play/d04885fc4aab9f77c0079dead750c746 to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
fn main() {
let A: i32 = 23;
let B: i32 = 16;
let C: i32 = 43;
match 23 {
A => println!("Input is equal to A"),
B => println!("Input is equal to B"),
C => println!("Input is equal to C"),
_ => println!("Input does not equal any value"),
}
match 42 {
A => println!("Input is equal to A"),
B => println!("Input is equal to B"),
C => println!("Input is equal to C"),
_ => println!("Input does not equal any value"),
}
match 16 {
A => println!("Input is equal to A"),
B => println!("Input is equal to B"),
C => println!("Input is equal to C"),
_ => println!("Input does not equal any value"),
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment