unwrapOrElse method
T
unwrapOrElse(
- T elseFn()
Returns the held value of this Option
if it is Some, or returns the
returned value from elseFn
if this Option
is None.
See also:
Rust: Option::unwrap_or_else()
Implementation
T unwrapOrElse(T Function() elseFn) => switch (this) {
Some(:T v) => v,
None() => elseFn()
};