Derive Default for Initializer in std_detect

This commit is contained in:
Eduardo Sánchez Muñoz 2023-10-30 13:19:11 +01:00 committed by Amanieu d'Antras
parent 4bfd9935f7
commit eaa7298694

View file

@ -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 {