unwrapOr method
T
unwrapOr(
- T orValue
Returns the held value of this Result
if it is Ok, or the given value
if this Result
is Err.
See also:
Rust: Result::unwrap_or()
Implementation
T unwrapOr(T orValue) {
return switch (this) {
Ok(:T v) => v,
Err() => orValue,
};
}