Last active
August 29, 2015 14:11
-
-
Save Shoozza/4a0a198b40618c3e68a2 to your computer and use it in GitHub Desktop.
rust scope
This file contains 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() { | |
struct Magic<T> { val: T } | |
let i = "string"; | |
println!("i = {}", i); | |
let Magic { val: mut i } = Magic { val: 5u }; | |
println!("i = {}", i); | |
i = 7; | |
println!("i = {}", i); | |
let (i,) = (33.1_f32,); | |
println!("i = {}", i); | |
/* output: | |
i = string | |
i = 5 | |
i = 7 | |
i = 33.099998 | |
*/ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment