Skip to content

Commit 021da30

Browse files
committed
Remove the .not() method - use the ! operator instead
1 parent 3c3d0bf commit 021da30

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

enumflags/src/lib.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,6 @@ where
188188
(self.bits() & other.bits()) == other.bits()
189189
}
190190

191-
/// Flips all flags
192-
pub fn not(self) -> Self {
193-
unsafe { BitFlags::new(!self.bits() & T::all()) }
194-
}
195-
196191
/// Returns a BitFlags iff the bits value does not contain any illegal flags.
197192
pub fn from_bits(bits: T::Type) -> Option<Self> {
198193
if bits & !Self::all().bits() == Self::empty().bits() {
@@ -306,7 +301,7 @@ where
306301
{
307302
type Output = BitFlags<T>;
308303
fn not(self) -> BitFlags<T> {
309-
self.not()
304+
unsafe { BitFlags::new(!self.bits() & T::all()) }
310305
}
311306
}
312307

0 commit comments

Comments
 (0)