unwrapOr method

T unwrapOr(
  1. T defaultValue
)

Returns the contained Some value or a provided default.

Arguments passed to unwrapOr are eagerly evaluated; if you are passing the option of a function call, it is recommended to use unwrapOrElse, which is lazily evaluated.

Implementation

T unwrapOr(T defaultValue) => isSome ? _someValue : defaultValue;