Skip to content

Instantly share code, notes, and snippets.

Created May 29, 2016 21:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/8d880aa6c6b674caef1dfe275a9f1f05 to your computer and use it in GitHub Desktop.
Save anonymous/8d880aa6c6b674caef1dfe275a9f1f05 to your computer and use it in GitHub Desktop.
Shared via Rust Playground
fn main() {
let list = vec![0, 1, 2, 3, 4, 5];
let index = 3;
if true {
println!("the magic number is {}", list[index]);
} else {
let other_index = 5;
println!("the index is {}", other_index);
println!("the magic number is {}", list[index]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment