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(value: T value) => Ok(mapFn(value)),
	Err(value: E value) => Err(value)
};