We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Default
Initializer
1 parent 3bacbac commit 1754913Copy full SHA for 1754913
crates/std_detect/src/detect/cache.rs
@@ -29,16 +29,11 @@ const fn unset_bit(x: u64, bit: u32) -> u64 {
29
const CACHE_CAPACITY: u32 = 62;
30
31
/// This type is used to initialize the cache
32
-#[derive(Copy, Clone)]
+// The derived `Default` implementation will initialize the field to zero,
33
+// which is what we want.
34
+#[derive(Copy, Clone, Default)]
35
pub(crate) struct Initializer(u64);
36
-#[allow(clippy::use_self)]
-impl Default for Initializer {
37
- fn default() -> Self {
38
- Initializer(0)
39
- }
40
-}
41
-
42
// NOTE: the `debug_assert!` would catch that we do not add more Features than
43
// the one fitting our cache.
44
impl Initializer {
0 commit comments