unwrapOr method

T unwrapOr(
  1. T defaultValue
)

Returns the contained Ok value or a provided default.

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

Implementation

T unwrapOr(T defaultValue) => isOk ? _okValue : defaultValue;