Skip to content

Instantly share code, notes, and snippets.

@swuecho
Forked from anonymous/playground.rs
Created December 21, 2016 17:56
Show Gist options
  • 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