Created
July 18, 2014 13:34
-
-
Save MatejLach/4a39616d7e35ec185181 to your computer and use it in GitHub Desktop.
Showcasing how expressions can be used in Rust
This file contains hidden or 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 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