unwrap method

T unwrap(
  1. Result<T, E> result
)

Returns the ok variant or throws the inner error

Implementation

T unwrap(Result<T, E> result) {
  if (result.isOk()) {
    return result.unwrap();
  }
  throw result.unwrapErr();
}