New Features in C# 7.0:
This is a Rust translation of a C#7 feature:
fn foo() -> (x: u32, y: u32) {
(10, 20)
}
fn main() {
let p = foo();
println!("{} {}", p.x, p.y);
let (a, b) = foo();
}
That equals to:
struct Pair { x: u32, y: u32 }
fn foo() -> Pair {
Pair { x: 10, y: 20 }
}
fn main() {
let p = foo();
println!("{} {}", p.x, p.y);
}