rust-book-cn/listings/ch06-enums-and-pattern-matching/no-listing-12-if-let/src/main.rs
2022-02-01 15:26:41 +08:00

9 lines
193 B
Rust

fn main() {
// ANCHOR: here
let config_max = Some(3u8);
if let Some(max) = config_max {
println!("The maximum is configured to be {}", max);
}
// ANCHOR_END: here
}