diff --git a/src/hashdb.rs b/src/hashdb.rs index eb41d23df..561c7843d 100644 --- a/src/hashdb.rs +++ b/src/hashdb.rs @@ -1,5 +1,4 @@ use hash::*; -use bytes::Bytes; pub trait HashDB { /// Look up a given hash into the bytes that hash to it, returning None if the diff --git a/src/memorydb.rs b/src/memorydb.rs index 58dc980ca..4ec02bd5e 100644 --- a/src/memorydb.rs +++ b/src/memorydb.rs @@ -104,9 +104,8 @@ impl MemoryDB { pub fn denote(&self, key: &H256, value: Bytes) -> &(Bytes, i32) { if self.data.get(&key) == None { unsafe { - let p = &self.data as *const HashMap; - let mp = p as *mut HashMap; - (*mp).insert(key.clone(), (value, 0)); + let p = &self.data as *const HashMap as *mut HashMap; + (*p).insert(key.clone(), (value, 0)); } } self.data.get(key).unwrap() @@ -161,7 +160,7 @@ fn memorydb_denote() { let hash = m.insert(hello_bytes); assert_eq!(m.lookup(&hash).unwrap(), b"Hello world!"); - for i in 0..1000 { + for _ in 0..1000 { let r = H256::random(); let k = r.sha3(); let &(ref v, ref rc) = m.denote(&k, r.bytes().to_vec()); diff --git a/src/overlaydb.rs b/src/overlaydb.rs index 86ad266c9..b6f2b3eb2 100644 --- a/src/overlaydb.rs +++ b/src/overlaydb.rs @@ -8,7 +8,6 @@ use hashdb::*; use memorydb::*; use std::ops::*; use std::sync::*; -use std::cell::*; use std::env; use rocksdb::{DB, Writable}; diff --git a/src/trie.rs b/src/trie.rs index 41c8f58ea..392e40a04 100644 --- a/src/trie.rs +++ b/src/trie.rs @@ -1,8 +1,8 @@ use memorydb::*; use hashdb::*; use hash::*; -use rlp::*; -use bytes::*; +//use rlp::*; +//use bytes::*; pub const NULL_RLP: [u8; 1] = [0x80; 1]; pub const SHA3_NULL_RLP: H256 = H256( [0x56, 0xe8, 0x1f, 0x17, 0x1b, 0xcc, 0x55, 0xa6, 0xff, 0x83, 0x45, 0xe6, 0x92, 0xc0, 0xf8, 0x6e, 0x5b, 0x48, 0xe0, 0x1b, 0x99, 0x6c, 0xad, 0xc0, 0x01, 0x62, 0x2f, 0xb5, 0xe3, 0x63, 0xb4, 0x21] );