rust/src/test/run-pass/struct-pattern-matching.rs

15 lines
178 B
Rust
Raw Normal View History

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))
}
}