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
163 B
13 lines
163 B
3 years ago
|
struct Point {
|
||
|
x: i32,
|
||
|
y: i32,
|
||
|
}
|
||
|
|
||
|
fn main() {
|
||
|
let p = Point { x: 0, y: 7 };
|
||
|
|
||
|
let Point { x, y } = p;
|
||
|
assert_eq!(0, x);
|
||
|
assert_eq!(7, y);
|
||
|
}
|