Option::unwrap_or
pub fn unwrap_or(T fallback) -> T
Source: compiler/src/prelude/core.hy The value, or fallback when None. x ?? fallback is the same.
Called on a Option value as value.unwrap_or(…).
Parameters#
| Name | Type |
|---|---|
fallback | T |
Returns#
T
See also#
OptionOption::is_some: True when this isSome.Option::is_none: True when this isNone.Option::unwrap_or_else: The value, or the result offwhenNone.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.