This is something I find myself doing a lot. Is there a more succinct way to do this?
let variable = if let Some(variable) = variable {
variable
} else {
return;
};
I know I could do a macro, and sometimes I might opt for that, but is there another way I'm missing?
When the function returns a result or an option, I can use the ?
operator to do the unwrap, but what if the function returns ()
?