Skip to content

Commit

Permalink
style: take ownership of header arg (paradigmxyz#1626)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse authored Mar 3, 2023
1 parent 9bdbbb2 commit 1bb25ae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion crates/net/downloaders/src/bodies/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ pub(crate) fn create_raw_bodies<'a>(
.into_iter()
.map(|header| {
let body = bodies.remove(&header.hash()).expect("body exists");
body.create_block(header)
body.create_block(header.as_ref().clone())
})
.collect()
}
Expand Down
4 changes: 2 additions & 2 deletions crates/net/eth-wire/src/types/blocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ pub struct BlockBody {

impl BlockBody {
/// Create a [`Block`](reth_primitives::Block) from the body and its header.
pub fn create_block(&self, header: &Header) -> Block {
pub fn create_block(&self, header: Header) -> Block {
Block {
header: header.clone(),
header,
body: self.transactions.clone(),
ommers: self.ommers.clone(),
withdrawals: self.withdrawals.clone(),
Expand Down

0 comments on commit 1bb25ae

Please sign in to comment.