err

Result.err converts Result<never, E> into Option<E>, None if the result is Ok.

Result<T, E>.err = () => Option<E>;

Example


div(2, 2) // => Ok(1)
  .err()  // => None