From 3105ed467ba70c28d28a227a28331176a4be3e41 Mon Sep 17 00:00:00 2001 From: LucaCappelletti94 Date: Wed, 21 Aug 2024 09:00:33 +0200 Subject: [PATCH] Added Default implementation for generic BuildHasher --- src/h2b.rs | 6 +++--- src/h3b.rs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/h2b.rs b/src/h2b.rs index dd4eebd..406c4c3 100644 --- a/src/h2b.rs +++ b/src/h2b.rs @@ -12,8 +12,8 @@ use crate::AHasherDefaultBuilder; /// different numbers of sub streams. /// /// Both the hasher and the sub stream size siaz can be customized, by default it uses `AHasherBuilder` and `M256` -#[derive(Debug, Eq, PartialEq, Hash, Clone)] #[cfg_attr(feature = "mem_dbg", derive(mem_dbg::MemDbg, mem_dbg::MemSize))] +#[derive(Debug, Eq, PartialEq, Hash, Clone)] pub struct HyperTwoBits { hash: HASH, sketch: SKETCH, @@ -21,10 +21,10 @@ pub struct HyperTwoBits Default for HyperTwoBits { +impl Default for HyperTwoBits { fn default() -> Self { Self { - hash: AHasherDefaultBuilder::default(), + hash: H::default(), sketch: SKETCH::default(), count: 0, t: 1, diff --git a/src/h3b.rs b/src/h3b.rs index 498d8ec..05f90ee 100644 --- a/src/h3b.rs +++ b/src/h3b.rs @@ -12,8 +12,8 @@ use crate::AHasherDefaultBuilder; /// different numbers of sub streams. /// /// Both the hasher and the sub stream size siaz can be customized, by default it uses `AHasherBuilder` and `M256` -#[derive(Debug, Eq, PartialEq, Hash, Clone)] #[cfg_attr(feature = "mem_dbg", derive(mem_dbg::MemDbg, mem_dbg::MemSize))] +#[derive(Debug, Eq, PartialEq, Hash, Clone)] pub struct HyperThreeBits { hash: HASH, sketch: SKETCH, @@ -21,10 +21,10 @@ pub struct HyperThreeBits Default for HyperThreeBits { +impl Default for HyperThreeBits { fn default() -> Self { Self { - hash: AHasherDefaultBuilder::default(), + hash: H::default(), sketch: SKETCH::default(), count: 0, t: 1,