use core::ops::RangeInclusive;
use crate::bitman::IsBitLow;
pub trait AreBitsHigh {
type Type;
fn are_bits_high(&self, range: RangeInclusive<Self::Type>) -> bool;
}
macro_rules! ImplementAreBitsHigh {
($type:ty) => {
impl AreBitsHigh for $type {
type Type = Self;
#[inline]
#[must_use]
fn are_bits_high(&self, range: RangeInclusive<Self>) -> bool {
for index in range {
if self.is_bit_low(index) {
return false;
}
}
true
}
}
};
}
ImplementAreBitsHigh!(u8);
ImplementAreBitsHigh!(u32);
ImplementAreBitsHigh!(u64);