transposeIn method

Result<S?, F> transposeIn()

transposes a nullable Result into a non-nullable Result. Note: transposeIn is named as such otherwise there is ambiguity if named the same as transposeOut (transpose).

Implementation

Result<S?, F> transposeIn() {
  if (this != null) {
    if (this!.isOk()) {
      return Ok(this!.unwrap());
    } else {
      return Err(this!.unwrapErr());
    }
  }
  return Ok(null);
}