diff options
| author | Eduardo Sánchez Muñoz <eduardosm-dev@e64.io> | 2023-10-30 13:19:11 +0100 |
|---|---|---|
| committer | Amanieu d'Antras <amanieu@gmail.com> | 2023-10-31 02:20:17 +0100 |
| commit | eaa729869492219f15f8219c3eb7577bfd0a9a42 (patch) | |
| tree | c118912d5efdeea1e90adf1966b7954e49d0df64 /library/stdarch/crates/std_detect/src/detect/cache.rs | |
| parent | 4bfd9935f77c7cd7023ce345815a3c67d2818fc2 (diff) | |
| download | rust-eaa729869492219f15f8219c3eb7577bfd0a9a42.tar.gz rust-eaa729869492219f15f8219c3eb7577bfd0a9a42.zip | |
Derive `Default` for `Initializer` in std_detect
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 { |
