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.
24 lines
398 B
24 lines
398 B
fn main() {
|
|
// ANCHOR: here
|
|
enum IpAddrKind {
|
|
V4,
|
|
V6,
|
|
}
|
|
|
|
struct IpAddr {
|
|
kind: IpAddrKind,
|
|
address: String,
|
|
}
|
|
|
|
let home = IpAddr {
|
|
kind: IpAddrKind::V4,
|
|
address: String::from("127.0.0.1"),
|
|
};
|
|
|
|
let loopback = IpAddr {
|
|
kind: IpAddrKind::V6,
|
|
address: String::from("::1"),
|
|
};
|
|
// ANCHOR_END: here
|
|
}
|