mirror of
https://github.com/KaiserY/trpl-zh-cn
synced 2025-05-06 21:59:45 +08:00
12 lines
225 B
Rust
12 lines
225 B
Rust
|
fn main() {
|
||
|
// ANCHOR: here
|
||
|
let num = Some(4);
|
||
|
|
||
|
match num {
|
||
|
Some(x) if x < 5 => println!("less than five: {}", x),
|
||
|
Some(x) => println!("{}", x),
|
||
|
None => (),
|
||
|
}
|
||
|
// ANCHOR_END: here
|
||
|
}
|