rust/src/test/run-pass/tup.rs
Brian Anderson 518dc52f85 Reformat
This changes the indexing syntax from .() to [], the vector syntax from ~[] to
[] and the extension syntax from #fmt() to #fmt[]
2011-08-20 11:04:00 -07:00

19 lines
307 B
Rust

// -*- rust -*-
type point = (int, int);
fn f(p: point, x: int, y: int) {
let (a, b) = p;
assert (a == x);
assert (b == y);
}
fn main() {
let p: point = (10, 20);
let (a, b) = p;
assert (a == 10);
assert (b == 20);
let p2: point = p;
f(p, 10, 20);
f(p2, 10, 20);
}