Crate ternop

Source
Expand description

A dead simple ternary operator macro which allows you to write quick one-line returnes for a variety of types.

§Examples

To use the ternary operator just invoke the ternary macro

fn is_ipv4(val: &str) -> i32 {
    ternary!(val == "ipv4", 4, 16)
}

Macros§

ternary