macro_rules! assert_none { ($a:expr $(,)?) => { ... }; ($a:expr, $($message:tt)+) => { ... }; }
Expand description
Assert expression is None.
Pseudocode:
a is None
-
If true, return
(). -
Otherwise, call
panic!with a message and the values of the expressions with their debug representations.
§Examples
let a: Option<i8> = Option::None;
assert_none!(a);
let a: Option<i8> = Option::Some(1);
assert_none!(a);
// assertion failed: `assert_none!(a)`
// https://docs.rs/assertables/8.9.0/assertables/macro.assert_none.html
// a label: `a`,
// a debug: `Some(1)`