ternop 1.0.1

A tiny macro that implements a ternary operator for Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
//! Small unit testing file for ternop

#[test]
fn ternary_testing() {
    let a = ternary![true, true, false];
    assert!(a == true);

    let b = ternary![a, 1, 2];
    assert!(b == 1);

    let c = ternary![b == 2, "yes", "noep!"];
    assert!(c == "noep!");
}