Macro assertables::assert_le
source · macro_rules! assert_le { ($a:expr, $b:expr $(,)?) => { ... }; ($a:expr, $b:expr, $($message:tt)+) => { ... }; }
Expand description
Assert a value is less than or equal to an expression.
-
If true, return
(). -
Otherwise, call
panic!with a message and the values of the expressions with their debug representations.
§Examples
let a = 1;
let b = 2;
assert_le!(a, b);
let a = 2;
let b = 1;
assert_le!(a, b);
// assertion failed: `assert_le!(a, b)`
// a label: `a`,
// a debug: `2`,
// b label: `b`,
// b debug: `1`,
// a: `2`,
// b: `1`