expect_ok

Macro expect_ok 

Source
macro_rules! expect_ok {
    ($expr:expr) => { ... };
    ($expr:expr, $message:expr) => { ... };
}
Expand description

Takes a Result and returns the unwrapped Ok value, or panics if it’s Err. The second argument is the message to use on panic. If the panic message is omitted, the Err value must be of type &str and is used as the panic message.

See also expect_some! and unwrap_ok!.