fix(compilation warnings) (#10649)

This commit is contained in:
Niklas Adolfsson
2019-05-13 15:10:25 +02:00
committed by GitHub
parent 42268fd1ef
commit 87699f8de0
7 changed files with 11 additions and 12 deletions

View File

@@ -273,7 +273,7 @@ impl Importer {
let (imported_blocks, import_results, invalid_blocks, imported, proposed_blocks, duration, has_more_blocks_to_import) = {
let mut imported_blocks = Vec::with_capacity(max_blocks_to_import);
let mut invalid_blocks = HashSet::new();
let mut proposed_blocks = Vec::with_capacity(max_blocks_to_import);
let proposed_blocks = Vec::with_capacity(max_blocks_to_import);
let mut import_results = Vec::with_capacity(max_blocks_to_import);
let _import_lock = self.import_lock.lock();

View File

@@ -287,8 +287,7 @@ impl Clique {
"Back-filling block state. last_checkpoint_number: {}, target: {}({}).",
last_checkpoint_number, header.number(), header.hash());
let mut chain: &mut VecDeque<Header> = &mut VecDeque::with_capacity(
(header.number() - last_checkpoint_number + 1) as usize);
let mut chain = VecDeque::with_capacity((header.number() - last_checkpoint_number + 1) as usize);
// Put ourselves in.
chain.push_front(header.clone());
@@ -332,7 +331,7 @@ impl Clique {
// Backfill!
let mut new_state = last_checkpoint_state.clone();
for item in chain {
for item in &chain {
new_state.apply(item, false)?;
}
new_state.calc_next_timestamp(header.timestamp(), self.period)?;

View File

@@ -277,7 +277,7 @@ impl Engine<EthereumMachine> for Arc<Ethash> {
let n_uncles = block.uncles.len();
// Bestow block rewards.
let mut result_block_reward = reward + reward.shr(5) * U256::from(n_uncles);
let result_block_reward = reward + reward.shr(5) * U256::from(n_uncles);
rewards.push((author, RewardKind::Author, result_block_reward));