Macro assertables::assure_io_le [−][src]
macro_rules! assure_io_le { ($left:expr, $right:expr $(,)?) => { ... }; ($left:expr, $right:expr, $($arg:tt)+) => { ... }; }
Expand description
Assure one value is less than or equal to another value.
-
When true, return
Ok(true). -
When false, return
Ok(false). -
Otherwise, return
Errwith a message and the values of the expressions with their debug representations.
Example
let x = assure_io_le!(1, 2); //-> Ok(true)
let x = assure_io_le!(2, 1); //-> Ok(false)
This macro has a second form where a custom message can be provided.