mirror of
https://github.com/KaiserY/trpl-zh-cn
synced 2024-11-14 21:11:31 +08:00
20 lines
282 B
Rust
20 lines
282 B
Rust
// ANCHOR: here
|
|
enum Coin {
|
|
Penny,
|
|
Nickel,
|
|
Dime,
|
|
Quarter,
|
|
}
|
|
|
|
fn value_in_cents(coin: Coin) -> u8 {
|
|
match coin {
|
|
Coin::Penny => 1,
|
|
Coin::Nickel => 5,
|
|
Coin::Dime => 10,
|
|
Coin::Quarter => 25,
|
|
}
|
|
}
|
|
// ANCHOR_END: here
|
|
|
|
fn main() {}
|