mirror of https://github.com/KaiserY/trpl-zh-cn
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
418 B
18 lines
418 B
fn main() {
|
|
// ANCHOR: here
|
|
let mut setting_value = Some(5);
|
|
let new_setting_value = Some(10);
|
|
|
|
match (setting_value, new_setting_value) {
|
|
(Some(_), Some(_)) => {
|
|
println!("Can't overwrite an existing customized value");
|
|
}
|
|
_ => {
|
|
setting_value = new_setting_value;
|
|
}
|
|
}
|
|
|
|
println!("setting is {setting_value:?}");
|
|
// ANCHOR_END: here
|
|
}
|