Skip to content

Instantly share code, notes, and snippets.

@paomian
Last active August 29, 2015 14:27
Show Gist options
  • Save paomian/d426d3538099885478bd to your computer and use it in GitHub Desktop.
Save paomian/d426d3538099885478bd to your computer and use it in GitHub Desktop.
struct Point {
x: int,
y: int,
}
fn transform(p: Point) -> Point {
Point { x: p.x + 1, y: p.y + 1}
}
fn main() {
let p0 = Point { x: 5, y: 10};
let p1 = transform(p0);
println!("{:?}", p1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment