Skip to content

Commit

Permalink
fix clippy issues
Browse files Browse the repository at this point in the history
  • Loading branch information
YeahNotSewerSide committed May 19, 2024
1 parent 6fd7521 commit 5e3677d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/blockchaintree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@ use crate::{
merkletree,
static_values::{
self, AMOUNT_SUMMARY, BLOCKS_PER_EPOCH, BYTE_GAS_PRICE, COINS_PER_CYCLE, GAS_SUMMARY,
MAIN_CHAIN_PAYMENT, OLD_AMOUNT_SUMMARY, OLD_GAS_SUMMARY, ROOT_PUBLIC_ADDRESS,
OLD_AMOUNT_SUMMARY, OLD_GAS_SUMMARY, ROOT_PUBLIC_ADDRESS,
},
tools,
transaction::Transaction,
transaction::Transactionable,
txpool,
types::Hash,
};
use error_stack::{Report, ResultExt};
Expand Down
6 changes: 4 additions & 2 deletions src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ impl MainChain {
.change_context(BlockChainTreeError::Chain(ChainErrorKind::DumpConfig))
.attach_printable("failed to write height")?;

file.write_all(self.difficulty.read().as_ref())
let difficulty = *self.difficulty.read();
file.write_all(&difficulty)
.await
.change_context(BlockChainTreeError::Chain(ChainErrorKind::DumpConfig))
.attach_printable("failed to write difficulty")?;
Expand Down Expand Up @@ -540,7 +541,8 @@ impl DerivativeChain {
.change_context(BlockChainTreeError::Chain(ChainErrorKind::DumpConfig))
.attach_printable("failed to write height")?;

file.write_all(self.difficulty.read().as_ref())
let difficulty = *self.difficulty.read();
file.write_all(&difficulty)
.await
.change_context(BlockChainTreeError::Chain(ChainErrorKind::DumpConfig))
.attach_printable("failed to write difficulty")?;
Expand Down

0 comments on commit 5e3677d

Please sign in to comment.