orElse<F> method

Result<T, F> orElse<F>(
  1. Result<T, F> fn(
    1. E
    )
)

Returns a Result value as Ok<T, F> if this Result is Ok<T, E>, otherwise calls fn with the held Err value and returns the returned Result.

See also: Rust: Result::or_else()

Implementation

Result<T, F> orElse<F>(Result<T, F> Function(E) fn) => switch (this) {
	Ok(value: T value) => Ok(value),
	Err(value: E value) => fn(value)
};