4 ms·
This isn't the only pattern that `if let` is suitable for. It's often used without an `else`, as a syntax sugar for match value { the_only_case_tha
by Expurple 2y ago
This isn't the only pattern that `if let` is suitable for. It's often used without an `else`, as a syntax sugar for
match value {
the_only_case_that_we_care_about => {
// Do something with the bound value.
},
_ => {}, // Don't do anything, we don't care about the other cases at all.
}