Module lib::assert_fn_err::assert_fn_err_le_expr

source ·
Expand description

Assert a function err() is less than or equal to an expression.

§Example

fn f(i: i8) -> Result<String, String> {
    match i {
        0..=9 => Ok(format!("{}", i)),
        _ => Err(format!("{:?} is out of range", i)),
    }
}

let a: i8 = 10;
let b = String::from("20 is out of range");
assert_fn_err_le_expr!(f, a, b);

§Module macros