It's mostly about avoiding nesting. Honestly, I'm still pretty ambivalent about it. But, before you might do:
if let Some(x) = maybe_x {
// do stuff with x
} else {
return;
}
now, you'd do:
let Some(x) = maybe_x else {
return;
}
// do stuff with x
If you have several instances of this kind of thing, the nesting can be pretty ugly and hard to read, so we'd sometimes do janky things to avoid the nesting, like:
let x = if let Some(x) = maybe_x { x } else { return; };
or,
if let (Some(x), Some(y)) = (maybe_x, maybe_y) {
// do stuff with x and y with only one layer of nesting
} else {
return;
}