macro_rules! assert_option_none { ($a:expr $(,)?) => { ... }; ($a:expr, $($message:tt)+) => { ... }; }
👎Deprecated: Please rename from
assert_option_none to assert_none because more developers prefer the shorter name.Expand description
Assert expression is None.
-
If true, return
(). -
Otherwise, call
panic!with a message and the values of the expressions with their debug representations.
§Examples
use assertables::*;
let a: Option<i8> = Option::None;
assert_option_none!(a);
// This will panic
let a: Option<i8> = Option::Some(1);
assert_option_none!(a);
// assertion failed: `assert_option_none!(a)`
// https://docs.rs/assertables/8.14.0/assertables/macro.assert_option_none.html
// a label: `a`,
// a debug: `Some(1)`