Method lrs::option::Option::map

If the value is present, replaces it by the result of a function application.

Syntax

impl<T> Option<T> {
    fn map<U, F>(self, f: F) -> Option<U>
        where F: FnOnce(T) -> U,
}

Arguments

NameDescription
f

The function that will be applied to the value.