trpl-zh-cn/listings/ch06-enums-and-pattern-matching/listing-06-04/src/main.rs

18 lines
235 B
Rust
Raw Normal View History

2022-02-06 16:43:51 +08:00
// ANCHOR: here
2022-02-07 14:36:29 +08:00
#[derive(Debug)] // 这样可以立刻看到州的名称
2022-02-06 16:43:51 +08:00
enum UsState {
Alabama,
Alaska,
// --snip--
}
enum Coin {
Penny,
Nickel,
Dime,
Quarter(UsState),
}
// ANCHOR_END: here
fn main() {}