ok method

Option<T> ok()

Converts this Result<T, E> into an Option<T>, discarding the held error value if this is Err.

Returns:

See also: Rust: Result::ok()

Implementation

Option<T> ok() {
  return switch (this) {
    Ok(:T v) => Some(v),
    Err() => None(),
  };
}