map<U> method

Result<U, E> map<U>(
  1. U mapFn(
    1. T
    )
)

Maps a Result<T, E> to a Result<U, E> using the given function with the held value.

Returns:

See also: Rust: Result::map()

Implementation

Result<U, E> map<U>(U Function(T) mapFn) => switch (this) {
	Ok(:T v) => Ok(mapFn(v)),
	Err(:E e) => Err(e)
};