Skip to content

Instantly share code, notes, and snippets.

@MatejLach
Created July 18, 2014 13:34
Show Gist options
  • Save MatejLach/4a39616d7e35ec185181 to your computer and use it in GitHub Desktop.
Save MatejLach/4a39616d7e35ec185181 to your computer and use it in GitHub Desktop.
Showcasing how expressions can be used in Rust
fn main() {
let x = 10i;
let y = if x < 5 {"x is less than 5"} else if x == 5 {"x is equal to 5"} else if x > 5 {"x is more than five!"} else {"x is unknown!"};
println!{"{}", y};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment