1
0
Fork 0
forked from wry/wry

autocommit 2022-01-28 03:35:35 CET

This commit is contained in:
Julian Orth 2022-01-28 03:35:35 +01:00
parent c340df0d08
commit a5573b8a3a
36 changed files with 3046 additions and 114 deletions

22
src/utils/bitflags.rs Normal file
View file

@ -0,0 +1,22 @@
pub trait BitflagsExt {
fn contains(self, other: Self) -> bool;
}
macro_rules! num {
($ty:ident) => {
impl BitflagsExt for $ty {
fn contains(self, other: Self) -> bool {
self & other != 0
}
}
};
}
num!(u8);
num!(u16);
num!(u32);
num!(u64);
num!(i8);
num!(i16);
num!(i32);
num!(i64);