mirror of
https://github.com/KaiserY/trpl-zh-cn
synced 2025-05-01 02:38:35 +08:00
13 lines
270 B
Rust
13 lines
270 B
Rust
fn main() {
|
|
let x = Some(5);
|
|
let y = 10;
|
|
|
|
match x {
|
|
Some(50) => println!("Got 50"),
|
|
Some(n) if n == y => println!("Matched, n = {n}"),
|
|
_ => println!("Default case, x = {x:?}"),
|
|
}
|
|
|
|
println!("at the end: x = {x:?}, y = {y}");
|
|
}
|