Skip to main content

CorrectnessResultExt

Trait CorrectnessResultExt 

Source
pub trait CorrectnessResultExt<T> {
    // Required method
    fn expect_display(self, msg: &str) -> T;
}
Expand description

Extension trait for CorrectnessResult that panics with the error’s Display form rather than its Debug form.

Use this instead of std::result::Result::expect when unwrapping a correctness result: expect formats the error with {:?}, which exposes the internal CorrectnessError struct layout in panic output, while CorrectnessResultExt::expect_display preserves the human-readable message defined on each variant.

Required Methods§

Source

fn expect_display(self, msg: &str) -> T

Returns the contained Ok value, panicking with msg: <error display> on Err.

Implementors§