Skip to content

Commit 01344a7

Browse files
Junha Yangmajecty
authored andcommitted
Fix errors from the newer clippy
1 parent 7f78272 commit 01344a7

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

src/journaldb/archivedb.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff 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() {

src/memorydb.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff 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 {

0 commit comments

Comments
 (0)