Purging .derefs, fixing clippy warnings. (#1890)
* Fixing clippy warnings * Purging derefs * Simplifying engine derefs * Simplifying more engine derefs
This commit is contained in:
committed by
Arkadiy Paronyan
parent
8018b69440
commit
a427208f79
@@ -258,7 +258,7 @@ pub fn get_temp_journal_db() -> GuardedTempResult<Box<JournalDB>> {
|
||||
|
||||
impl MiningBlockChainClient for TestBlockChainClient {
|
||||
fn prepare_open_block(&self, author: Address, gas_range_target: (U256, U256), extra_data: Bytes) -> OpenBlock {
|
||||
let engine = &self.spec.engine;
|
||||
let engine = &*self.spec.engine;
|
||||
let genesis_header = self.spec.genesis_header();
|
||||
let mut db_result = get_temp_journal_db();
|
||||
let mut db = db_result.take();
|
||||
@@ -266,7 +266,7 @@ impl MiningBlockChainClient for TestBlockChainClient {
|
||||
|
||||
let last_hashes = vec![genesis_header.hash()];
|
||||
let mut open_block = OpenBlock::new(
|
||||
engine.deref(),
|
||||
engine,
|
||||
self.vm_factory(),
|
||||
Default::default(),
|
||||
false,
|
||||
@@ -482,9 +482,9 @@ impl BlockChainClient for TestBlockChainClient {
|
||||
if number == len {
|
||||
{
|
||||
let mut difficulty = self.difficulty.write();
|
||||
*difficulty.deref_mut() = *difficulty.deref() + header.difficulty;
|
||||
*difficulty = *difficulty + header.difficulty;
|
||||
}
|
||||
mem::replace(self.last_hash.write().deref_mut(), h.clone());
|
||||
mem::replace(&mut *self.last_hash.write(), h.clone());
|
||||
self.blocks.write().insert(h.clone(), b);
|
||||
self.numbers.write().insert(number, h.clone());
|
||||
let mut parent_hash = header.parent_hash;
|
||||
|
||||
Reference in New Issue
Block a user