mapOrElse<U> method
Implementation
Result<U, E> mapOrElse<U>(
U Function(T value) onOk,
U Function(E error) onErr,
) {
if (this is Ok<T, E>) {
return Ok(onOk((this as Ok<T, E>).value));
}
return Err((this as Err<T, E>).error);
}