Skip to content

Instantly share code, notes, and snippets.

@Shoozza
Last active August 29, 2015 14:11
Show Gist options
  • Save Shoozza/4a0a198b40618c3e68a2 to your computer and use it in GitHub Desktop.
Save Shoozza/4a0a198b40618c3e68a2 to your computer and use it in GitHub Desktop.
rust scope
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