4 releases

0.1.3 Jun 14, 2019
0.1.2 Jun 14, 2019
0.1.1 Jun 13, 2019
0.1.0 Jun 13, 2019

#23 in #give

MIT license

3KB

Package rit

Package rit is a bit operation lib for rust. It gives 4 marcos for get, set and reset a bit for any number type.

[dependencies]
rit = "0.1"

Examples

fn main() {
    assert_eq!(rit::eq1!(0b0000_1111, 0), true);
    assert_eq!(rit::eq0!(0b0000_1111, 4), true);
    assert_eq!(rit::set!(0b0000_1111, 0), 0x0f);
    assert_eq!(rit::clr!(0b0000_1111, 0), 0x0e);
}

No runtime deps