diff --git a/hashdb/Cargo.toml b/hashdb/Cargo.toml index f5e63fb..37b175f 100644 --- a/hashdb/Cargo.toml +++ b/hashdb/Cargo.toml @@ -6,5 +6,4 @@ description = "trait for hash-keyed databases." license = "GPL-3.0" [dependencies] -elastic-array = "0.10" -heapsize = "0.4" \ No newline at end of file +elastic-array = "0.10" \ No newline at end of file diff --git a/hashdb/src/lib.rs b/hashdb/src/lib.rs index 4f5bed4..a404b4f 100644 --- a/hashdb/src/lib.rs +++ b/hashdb/src/lib.rs @@ -16,10 +16,8 @@ //! Database of byte-slices keyed to their hash. extern crate elastic_array; -extern crate heapsize; use elastic_array::ElasticArray128; -use heapsize::HeapSizeOf; use std::collections::HashMap; use std::{fmt::Debug, hash::Hash}; @@ -28,7 +26,7 @@ use std::{fmt::Debug, hash::Hash}; /// `Out` associated type with the necessary bounds. pub trait Hasher: Sync + Send { /// The output type of the `Hasher` - type Out: AsRef<[u8]> + AsMut<[u8]> + Default + HeapSizeOf + Debug + PartialEq + Eq + Hash + Send + Sync + Clone + Copy; + type Out: AsRef<[u8]> + AsMut<[u8]> + Default + Debug + PartialEq + Eq + Hash + Send + Sync + Clone + Copy; /// What to use to build `HashMap`s with this `Hasher` type StdHasher: Sync + Send + Default + std::hash::Hasher; /// The length in bytes of the `Hasher` output diff --git a/memorydb/src/lib.rs b/memorydb/src/lib.rs index d49ce9d..f07bce8 100644 --- a/memorydb/src/lib.rs +++ b/memorydb/src/lib.rs @@ -87,11 +87,11 @@ pub struct MemoryDB { hashed_null_node: H::Out, } -impl Default for MemoryDB { +impl Default for MemoryDB where H: KeyHasher, H::Out: HeapSizeOf { fn default() -> Self { Self::new() } } -impl MemoryDB { +impl MemoryDB where H: KeyHasher, H::Out: HeapSizeOf { /// Create a new instance of the memory DB. pub fn new() -> MemoryDB { MemoryDB { diff --git a/patricia_trie/Cargo.toml b/patricia_trie/Cargo.toml index be80eae..2d08e8b 100644 --- a/patricia_trie/Cargo.toml +++ b/patricia_trie/Cargo.toml @@ -7,11 +7,10 @@ license = "GPL-3.0" [dependencies] elastic-array = "0.10" -heapsize = "0.4" log = "0.3" rand = "0.4" -hashdb = { version = "0.2.0", path = "../hashdb" } -parity-bytes = { version = "0.1.0", path = "../parity-bytes" } +hashdb = { version = "0.2", path = "../hashdb" } +parity-bytes = { version = "0.1", path = "../parity-bytes" } [dev-dependencies] env_logger = "0.5" diff --git a/patricia_trie/src/lib.rs b/patricia_trie/src/lib.rs index 36d6167..b09685d 100644 --- a/patricia_trie/src/lib.rs +++ b/patricia_trie/src/lib.rs @@ -18,7 +18,6 @@ extern crate elastic_array; extern crate parity_bytes as bytes; // TODO: name changed; update upstream when `parity-common` is available extern crate hashdb; -extern crate heapsize; extern crate rand; #[macro_use] extern crate log; diff --git a/patricia_trie/src/triedbmut.rs b/patricia_trie/src/triedbmut.rs index 51005e9..fc6c3e4 100644 --- a/patricia_trie/src/triedbmut.rs +++ b/patricia_trie/src/triedbmut.rs @@ -31,7 +31,6 @@ use std::collections::{HashSet, VecDeque}; use std::marker::PhantomData; use std::mem; use std::ops::Index; -use heapsize::HeapSizeOf; use std::{fmt::Debug, hash::Hash}; // For lookups into the Node storage buffer. @@ -79,7 +78,7 @@ enum Node { Branch(Box<[Option>; 16]>, Option) } -impl Node where O: AsRef<[u8]> + AsMut<[u8]> + Default + HeapSizeOf + Debug + PartialEq + Eq + Hash + Send + Sync + Clone + Copy { +impl Node where O: AsRef<[u8]> + AsMut<[u8]> + Default + Debug + PartialEq + Eq + Hash + Send + Sync + Clone + Copy { // load an inline node into memory or get the hash to do the lookup later. fn inline_or_hash(node: &[u8], db: &HashDB, storage: &mut NodeStorage) -> NodeHandle where C: NodeCodec,