Remove redundant bindings

This commit is contained in:
Jonas Platte
2023-08-22 12:22:45 +02:00
parent 52a9039019
commit 11b24f7898
2 changed files with 4 additions and 13 deletions
+3 -9
View File
@@ -382,25 +382,19 @@ impl EventFlags {
const HAS_ID: Self = Self::from_bits(0b1000);
const fn bits(&self) -> u8 {
let bits = self;
bits.0
self.0
}
const fn from_bits(bits: u8) -> Self {
let bits = bits;
Self(bits)
}
const fn contains(&self, other: Self) -> bool {
let same = self;
let other = other;
same.bits() & other.bits() == other.bits()
self.bits() & other.bits() == other.bits()
}
fn insert(&mut self, other: Self) {
let same = self;
let other = other;
*same = Self::from_bits(same.bits() | other.bits());
*self = Self::from_bits(self.bits() | other.bits());
}
}
+1 -4
View File
@@ -32,14 +32,11 @@ impl MethodFilter {
}
const fn from_bits(bits: u16) -> Self {
let bits = bits;
Self(bits)
}
pub(crate) const fn contains(&self, other: Self) -> bool {
let same = self;
let other = other;
same.bits() & other.bits() == other.bits()
self.bits() & other.bits() == other.bits()
}
/// Performs the OR operation between the [`MethodFilter`] in `self` with `other`.