err method

Option<E> err()

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

See also: Rust: Result::err()

Implementation

Option<E> err() => switch (this) {
      Ok() => None(),
      Err(:E e) => Some(e),
    };