::std::conv::

Function tri_to_bool

pub fn tri_to_bool(t: tri) -> bool
Expand

Casts a tri to a bool by reinterpreting its bit.

LOW and HIGH map to true and false respectively, but the result for HIGHIMP is undefined. In practice, in a simulator, it remains a high impedance value.

Examples

assert tri_to_bool(LOW) == false;
assert tri_to_bool(HIGH) == true;