Skip to content

Instantly share code, notes, and snippets.

@grahamking

grahamking/gist:5463592

Last active Dec 16, 2015
Embed
What would you like to do?
rust question
struct Point {
x: int,
y: int
}
fn one() {
let mut a = ~Point{x: 10, y: 20};
a.x = 42;
println(a.x.to_str());
}
fn two() {
let a = @mut Point{x: 10, y: 20};
a.x = 42;
println(a.x.to_str());
}
fn main() {
one();
two();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment