Skip to content

Commit f6d33d5

Browse files
committed
internal: rename all to all_bits
1 parent 8a53918 commit f6d33d5

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

enumflags_derive/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ fn gen_enumflags(ident: &Ident, item: &DeriveInput, data: &DataEnum)
221221
impl ::enumflags2::_internal::RawBitFlags for #ident {
222222
type Type = #ty;
223223

224-
fn all() -> Self::Type {
224+
fn all_bits() -> Self::Type {
225225
// make sure it's evaluated at compile time
226226
const VALUE: #ty = #all;
227227
VALUE

src/lib.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ pub mod _internal {
113113
type Type: BitFlagNum;
114114

115115
/// Return a value with all flag bits set.
116-
fn all() -> Self::Type;
116+
fn all_bits() -> Self::Type;
117117

118118
/// Return the bits as a number type.
119119
fn bits(self) -> Self::Type;
@@ -213,12 +213,12 @@ where
213213

214214
/// Create a BitFlags with all flags set.
215215
pub fn all() -> Self {
216-
unsafe { BitFlags::new(T::all()) }
216+
unsafe { BitFlags::new(T::all_bits()) }
217217
}
218218

219219
/// Returns true if all flags are set
220220
pub fn is_all(self) -> bool {
221-
self.val == T::all()
221+
self.val == T::all_bits()
222222
}
223223

224224
/// Returns true if no flag is set
@@ -263,7 +263,7 @@ where
263263

264264
/// Truncates flags that are illegal
265265
pub fn from_bits_truncate(bits: T::Type) -> Self {
266-
unsafe { BitFlags::new(bits & T::all()) }
266+
unsafe { BitFlags::new(bits & T::all_bits()) }
267267
}
268268

269269
/// Toggles the matching bits
@@ -326,7 +326,7 @@ where
326326
{
327327
type Output = BitFlags<T>;
328328
fn bitxor(self, other: B) -> BitFlags<T> {
329-
unsafe { BitFlags::new((self.bits() ^ other.into().bits()) & T::all()) }
329+
unsafe { BitFlags::new(self.bits() ^ other.into().bits()) }
330330
}
331331
}
332332

@@ -365,7 +365,7 @@ where
365365
{
366366
type Output = BitFlags<T>;
367367
fn not(self) -> BitFlags<T> {
368-
unsafe { BitFlags::new(!self.bits() & T::all()) }
368+
unsafe { BitFlags::new(!self.bits() & T::all_bits()) }
369369
}
370370
}
371371

0 commit comments

Comments
 (0)