map<U> method

Option<U> map<U>(
  1. U mapFn(
    1. T
    )
)

Maps this Option<T> to an Option<U> using the given function with the held value.

Returns:

See also: Rust: Option::map()

Implementation

Option<U> map<U>(U Function(T) mapFn) => switch (this) {
	Some(:T v) => Some(mapFn(v)),
	None() => None()
};