diff options
Diffstat (limited to 'library/stdarch/crates/std_detect/src/detect/cache.rs')
| -rw-r--r-- | library/stdarch/crates/std_detect/src/detect/cache.rs | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/library/stdarch/crates/std_detect/src/detect/cache.rs b/library/stdarch/crates/std_detect/src/detect/cache.rs index a94c655c3a9..64b2841bbf3 100644 --- a/library/stdarch/crates/std_detect/src/detect/cache.rs +++ b/library/stdarch/crates/std_detect/src/detect/cache.rs @@ -29,16 +29,11 @@ const fn unset_bit(x: u64, bit: u32) -> u64 { const CACHE_CAPACITY: u32 = 62; /// This type is used to initialize the cache -#[derive(Copy, Clone)] +// The derived `Default` implementation will initialize the field to zero, +// which is what we want. +#[derive(Copy, Clone, Default)] pub(crate) struct Initializer(u64); -#[allow(clippy::use_self)] -impl Default for Initializer { - fn default() -> Self { - Initializer(0) - } -} - // NOTE: the `debug_assert!` would catch that we do not add more Features than // the one fitting our cache. impl Initializer { |
