mirror of https://github.com/KaiserY/trpl-zh-cn
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
169 B
13 lines
169 B
3 years ago
|
struct Point {
|
||
|
x: i32,
|
||
|
y: i32,
|
||
|
}
|
||
|
|
||
|
fn main() {
|
||
|
let p = Point { x: 0, y: 7 };
|
||
|
|
||
|
let Point { x: a, y: b } = p;
|
||
|
assert_eq!(0, a);
|
||
|
assert_eq!(7, b);
|
||
|
}
|