File tree Expand file tree Collapse file tree 2 files changed +2
-6
lines changed
Expand file tree Collapse file tree 2 files changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -199,7 +199,6 @@ mod tests {
199199 use super :: * ;
200200 use crate :: JournalDB ;
201201 use codechain_crypto:: blake256;
202- use kvdb_memorydb;
203202
204203 #[ test]
205204 fn insert_same_in_fork ( ) {
Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ impl MemoryDB {
104104
105105 /// Return the internal map of hashes to data, clearing the current state.
106106 pub fn drain ( & mut self ) -> H256FastMap < ( DBValue , i32 ) > {
107- mem:: replace ( & mut self . data , H256FastMap :: default ( ) )
107+ mem:: take ( & mut self . data )
108108 }
109109
110110 /// Grab the raw information associated with a key. Returns None if the key
@@ -186,10 +186,7 @@ impl HashDB for MemoryDB {
186186 return true
187187 }
188188
189- match self . data . get ( key) {
190- Some ( & ( _, x) ) if x > 0 => true ,
191- _ => false ,
192- }
189+ matches ! ( self . data. get( key) , Some ( & ( _, x) ) if x > 0 )
193190 }
194191
195192 fn insert ( & mut self , value : & [ u8 ] ) -> H256 {
You can’t perform that action at this time.
0 commit comments