mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-26 00:00:23 +02:00
Remove redundant bindings
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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`.
|
||||
|
||||
Reference in New Issue
Block a user