rust/src/test/run-pass/struct-pattern-matching.rs
2012-08-06 17:36:24 -07:00

15 lines
178 B
Rust

struct Foo {
x: int;
y: int;
}
fn main() {
let a = Foo { x: 1, y: 2 };
match a {
Foo { x: x, y: y } => io::println(fmt!("yes, %d, %d", x, y))
}
}