pub trait ShouldBeOk<T> {
    // Required method
    fn should_be_ok(self) -> T;
}
Expand description

An alias of unwrap() to mark where we are really have confidence to do unwrap.

We can also customize the panic message or do something else in this alias.

Required Methods§

source

fn should_be_ok(self) -> T

Unwraps an Option or a Result with confidence and we assume that it’s impossible to fail.

Implementations on Foreign Types§

source§

impl<T> ShouldBeOk<T> for Option<T>

source§

fn should_be_ok(self) -> T

Implementors§