unwrapOrElse method

T unwrapOrElse(
  1. T f()
)

Returns the option if it contains a value, otherwise returns other.

Implementation

T unwrapOrElse(T Function() f) {
  return switch (this) {
    Some(:final v) => v,
    _ => f(),
  };
}