From b08d1710a0ea3ed4dc07c6a4c4dc279ab22fac79 Mon Sep 17 00:00:00 2001 From: Magamedrasul Ibragimov Date: Sat, 29 Oct 2022 14:31:15 +0300 Subject: [PATCH] chore: update hasher in Merkle Tree as a PhantomData --- src/tree.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/tree.rs b/src/tree.rs index 54da939..e35f6b4 100644 --- a/src/tree.rs +++ b/src/tree.rs @@ -1,4 +1,5 @@ use crate::*; +use std::marker::PhantomData; // db[DEPTH_KEY] = depth const DEPTH_KEY: DBKey = (usize::MAX - 1).to_be_bytes(); @@ -22,7 +23,7 @@ where H: Hasher, { db: D, - h: H, + h: PhantomData, depth: usize, next_index: usize, } @@ -56,7 +57,7 @@ where Self { db, - h: H::new(), + h: PhantomData, depth, next_index, } @@ -77,7 +78,7 @@ where Self { db, - h: H::new(), + h: PhantomData, depth, next_index, }