7.5.1.1 tuples
튜플은 다음과 같이 match에서 역구조화 될 수 있다.
fn main() {
let pair = (0, -2);
// TODO ^ `pair`에 다른 값을 넣어보세요.
println!("Tell me about {:?}", pair);
// 매치는 튜플의 역구조화 하는데 사용될 수 있다.
match pair {
// 두 번째 역구조화
(0, y) => println!("First is `0` and `y` is `{:?}`", y),
(x, 0) => println!("`x` is `{:?}` and last is `0`", x),
_ => println!("It doesn't matter what they are"),
// `_`의 의미는 값을 변수에 바인드하지 않는 것.
}
}