Skip to content

Commit

Permalink
chore: clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
storopoli committed Feb 1, 2025
1 parent 57c84a1 commit f9fda85
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion crates/proof-impl/btc-blockspace/src/merkle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ fn merkle_root_r(hashes: &mut [Buf32]) -> Buf32 {
return hashes[0];
}

for idx in 0..((hashes.len() + 1) / 2) {
for idx in 0..hashes.len().div_ceil(2) {
let idx1 = 2 * idx;
let idx2 = std::cmp::min(idx1 + 1, hashes.len() - 1);
let mut vec = Vec::with_capacity(64);
Expand Down
2 changes: 1 addition & 1 deletion crates/reth/node/src/payload_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ where
tx_type: tx.tx_type(),
success: result.is_success(),
cumulative_gas_used,
logs: result.into_logs().into_iter().map(Into::into).collect(),
logs: result.into_logs().into_iter().collect(),

Check warning on line 406 in crates/reth/node/src/payload_builder.rs

View check run for this annotation

Codecov / codecov/patch

crates/reth/node/src/payload_builder.rs#L406

Added line #L406 was not covered by tests
..Default::default()
}));

Expand Down
4 changes: 2 additions & 2 deletions crates/reth/rpc/src/eth/pending_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ where
.map(|tx| tx.blob_gas_used().unwrap_or_default())
.sum::<u64>()
}),
excess_blob_gas: block_env.get_blob_excess_gas().map(Into::into),
excess_blob_gas: block_env.get_blob_excess_gas(),

Check warning on line 130 in crates/reth/rpc/src/eth/pending_block.rs

View check run for this annotation

Codecov / codecov/patch

crates/reth/rpc/src/eth/pending_block.rs#L130

Added line #L130 was not covered by tests
extra_data: Default::default(),
parent_beacon_block_root: is_cancun.then_some(B256::ZERO),
requests_hash: is_prague.then_some(EMPTY_REQUESTS_HASH),
Expand Down Expand Up @@ -156,7 +156,7 @@ where
tx_type: tx.tx_type(),
success: result.is_success(),
cumulative_gas_used,
logs: result.into_logs().into_iter().map(Into::into).collect(),
logs: result.into_logs().into_iter().collect(),

Check warning on line 159 in crates/reth/rpc/src/eth/pending_block.rs

View check run for this annotation

Codecov / codecov/patch

crates/reth/rpc/src/eth/pending_block.rs#L159

Added line #L159 was not covered by tests
..Default::default()
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/util/mmr/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ impl<H: MerkleHasher + Clone> MerkleMr<H> {
let mut roots = vec![zero(); compact.cap_log2 as usize];
let mut at = 0;
for i in 0..compact.cap_log2 {
if compact.entries >> i & 1 != 0 {
if (compact.entries >> i) & 1 != 0 {
roots[i as usize] = compact.roots[at as usize];
at += 1;
}
Expand Down

0 comments on commit f9fda85

Please sign in to comment.