trpl-zh-cn/listings/ch18-patterns-and-matching/no-listing-03-ranges/src/main.rs
2022-02-06 16:43:51 +08:00

11 lines
182 B
Rust
Executable File

fn main() {
// ANCHOR: here
let x = 5;
match x {
1..=5 => println!("one through five"),
_ => println!("something else"),
}
// ANCHOR_END: here
}