Skip to content

Commit

Permalink
Fix errors from the newer clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
junha1 authored and majecty committed Aug 12, 2020
1 parent 7f78272 commit 01344a7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
1 change: 0 additions & 1 deletion src/journaldb/archivedb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ mod tests {
use super::*;
use crate::JournalDB;
use codechain_crypto::blake256;
use kvdb_memorydb;

#[test]
fn insert_same_in_fork() {
Expand Down
7 changes: 2 additions & 5 deletions src/memorydb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ impl MemoryDB {

/// Return the internal map of hashes to data, clearing the current state.
pub fn drain(&mut self) -> H256FastMap<(DBValue, i32)> {
mem::replace(&mut self.data, H256FastMap::default())
mem::take(&mut self.data)
}

/// Grab the raw information associated with a key. Returns None if the key
Expand Down Expand Up @@ -186,10 +186,7 @@ impl HashDB for MemoryDB {
return true
}

match self.data.get(key) {
Some(&(_, x)) if x > 0 => true,
_ => false,
}
matches!(self.data.get(key), Some(&(_, x)) if x > 0)
}

fn insert(&mut self, value: &[u8]) -> H256 {
Expand Down

0 comments on commit 01344a7

Please sign in to comment.