soft_assert

Macro soft_assert 

Source
macro_rules! soft_assert {
    ($e:expr) => { ... };
    ($e:expr,) => { ... };
    ($e:expr, $failed:expr) => { ... };
    ($e:expr, $failed:expr,) => { ... };
}
Expand description

Asserts a condition is true, returning otherwise.

Non-panicking version of assert.

§Custom return values

Unless otherwise specified, this will return the default value of the return type (if it has one). A custom value can be returned instead by supplying it as an additional argument (similar to assert’s custom message), i.e. soft_assert!(false, Err(e)). Ownership of any captured values is only taken if the assertion fails, so you can continue to use them later on.

This does not perform Err(..)-wrapping, to allow returning any value.