by vasilakisfil · 4y ago · 0 comments
if foo.is_none() {
return;
}
let foo = foo.unwrap()
Now I can do simply let Some(foo_unwrapped) = foo else {
return;
}
which is prettier than the `if let (...)` to just unwrap it IMO. let foo_unwrapped = match foo {
Some(foo_unwrapped) => foo_unwrapped,
None => return,
};
Not as pretty, but you don't have to unwrap. let x_result = something;
let Ok(x) = x_result else {
...
}
But I expect that it will be used mostly with Option, as in "else continue" or "else break".