Macro assertables::assure_fn_ok_gt[][src]

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

Assure one function ok() is greater than another function ok().

  • When true, return Ok(true).

  • When false, return Ok(false).

  • Otherwise, return Err with a message and the values of the expressions with their debug representations.

Examples

let x: Result<bool, &str> = assure_fn_ok_gt!(i32::from_str, "2", "1");
//-> Ok(true)
let x: Result<bool, &str> = assure_fn_ok_gt!(i32::from_str, "1", "2");
//-> Ok(false)

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