macro_rules! assert_gt {
    ($left:expr, $right:expr $(,)?) => { ... };
    ($left:expr, $right:expr, $($arg:tt)+) => { ... };
}
Expand description

Assert a value is greater than another.

  • When true, return ().

  • Otherwise, call panic! with a message and the values of the expressions with their debug representations.

Examples

assert_gt!(2, 1);
//-> ()

assert_gt!(1, 2);
//-> panic!
// assertion failed: `assert_gt!(left, right)`
//   left: `1`,
//  right: `2`

This macro has a second form where a custom message can be provided.