Macro macrors::ternary_ne

source ·
macro_rules! ternary_ne {
    ($left:expr, $right:expr, $true_expr:expr, $false_expr:expr) => { ... };
}
Expand description

A macro for ternary conditional operation with equality comparison.

This macro compares two values and returns one of two expressions based on whether the values are equal or not.

§Examples

use macrors::ternary_eq;

let x = 5;
let y = 10;

let result_eq = ternary_eq!(x, y, "x is equal to y", "x is not equal to y");
assert_eq!(result_eq, "x is not equal to y");