3 ms·
Ah, I meant the "or" operator, in Rust you have to match on the option result right? match maybe_error { Ok/Some(val) => None/Err => }
by gavinray 6y ago
Ah, I meant the "or" operator, in Rust you have to match on the option result right?
match maybe_error {
Ok/Some(val) =>
None/Err =>
}
- hardwaregeek 6y agoYou can do result.or_else(|err| ... ) Or result.map(|value| ... )
- gavinray 6y agoAh welp, fair enough that's on me for being clueless. Edited my answer.
- edflsafoiewq 6y agoYou can do result or { break }. You can't do that from a closure.