Method lrs::option::Option::unwrap_or

Unwraps the value or returns another one.

Syntax

impl<T> Option<T> {
    fn unwrap_or(self, val: T) -> T
}

Arguments

NameDescription
val

The object that will be returned if the value is not present.

Return value

Returns the contained value or val if the value is not present.