let some_u8_value = Some(0u8);
// Without `if let`
match some_u8_value {
Some(3) => println!("three");
- => (),
}
// With `if let`
if let Some(3) = some_u8_value {
println!("three");
}
let some_u8_value = Some(0u8);
// Without `if let`
match some_u8_value {
Some(3) => println!("three");
- => (),
}
// With `if let`
if let Some(3) = some_u8_value {
println!("three");
}