Skip to content

Instantly share code, notes, and snippets.

@swuecho
Forked from anonymous/playground.rs
Created December 21, 2016 17:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save swuecho/41b08932d9bbbe4ae7ad8440d625b545 to your computer and use it in GitHub Desktop.
Save swuecho/41b08932d9bbbe4ae7ad8440d625b545 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