Skip to content

Instantly share code, notes, and snippets.

Created December 21, 2016 17:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/296528b5026124e32afd751525ef649c to your computer and use it in GitHub Desktop.
Save anonymous/296528b5026124e32afd751525ef649c to your computer and use it in GitHub Desktop.
Shared via Rust Playground
struct Point {
x: i32,
y: i32,
}
fn takes_point(Point {x, y}: Point) {
println!("({}, {})", x, y);
}
fn main() {
let origin = Point { x: 0, y: 0 };
takes_point(origin);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment