Option::unwrap_or_else
pub fn unwrap_or_else(fn() -> T f) -> T
Source: compiler/src/prelude/core.hy The value, or the result of f when None.
Called on a Option value as value.unwrap_or_else(…).
Parameters#
| Name | Type |
|---|---|
f | fn() -> T |
Returns#
T
See also#
OptionOption::is_some: True when this isSome.Option::is_none: True when this isNone.Option::unwrap_or: The value, orfallbackwhenNone.Option::map:Some(f(value)), orNone.Option::map_or:f(value), orfallbackwhenNone.Option::and_then:f(value)(itself anOption), orNone.Option::or: This option if it isSome, otherwiseother.