trpl-zh-cn/listings/ch19-patterns-and-matching/no-listing-02-multiple-patterns/src/main.rs
2024-10-20 23:44:05 +08:00

12 lines
202 B
Rust

fn main() {
// ANCHOR: here
let x = 1;
match x {
1 | 2 => println!("one or two"),
3 => println!("three"),
_ => println!("anything"),
}
// ANCHOR_END: here
}