by the__alchemist · 1y ago · 0 comments
if param.is_none() {
// Handle, and continue, return an error etc
}
let value = param.as_ref().unwrap(); // or as_mut
// Use `value` as normal. let value = Some(param.as_ref()) else {
// Handle, and continue, return an error etc
}
// Use `value` as normal. let Some(value) = param.as_ref() else {
// Handle, and continue, return an error etc
}
// Use `value` as normal.That said, much like it took me a while to Grok if let syntax... this will be a struggle. See the other example in this thread where the one suggesting it reversed the syntax. That will take a bit to get right...