4 ms·
I missed `guard let` for a while too, but eventually stumbled upon this pattern which is almost as good: let value = match value { None => return,
by danappelxx 6y ago
I missed `guard let` for a while too, but eventually stumbled upon this pattern which is almost as good:
let value = match value {
None => return,
Some(value) => value
};
- papaf 6y agoI use match as an inside out 'if let' but in this particular case I prefer to: let value = value.ok_or(MyError)?;