mirror of
https://github.com/KaiserY/trpl-zh-cn
synced 2025-05-05 04:58:03 +08:00
12 lines
251 B
Rust
Executable File
12 lines
251 B
Rust
Executable File
fn main() {
|
|
// ANCHOR: here
|
|
let num = Some(4);
|
|
|
|
match num {
|
|
Some(x) if x % 2 == 0 => println!("The number {} is even", x),
|
|
Some(x) => println!("The number {} is odd", x),
|
|
None => (),
|
|
}
|
|
// ANCHOR_END: here
|
|
}
|