okOr<E extends Object> method

Result<T, E> okOr<E extends Object>(
  1. E err
)

Transforms the Option

Implementation

Result<T, E> okOr<E extends Object>(E err) {
  if (v == null) {
    return Err(err);
  } else {
    return Ok(v!);
  }
}