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

Extension trait for Result<T, Never> that adds infallible_unwrap(), an infallible version of unwrap().

Required Methods§

source

fn infallible_unwrap(self) -> T

Similar to unwrap(), but can never fail. This is only available on Result<T, Never> types that are used as a result of operations that cannot return an error. Calling infallible_unwrap() instead of unwrap() uses the type system to ensure that you don’t accidentally unwrap a type that might contain an error.

Implementations on Foreign Types§

source§

impl<T> InfallibleUnwrap<T> for Result<T, Never>

Implementors§