style: take ownership of header arg (#1626)

This commit is contained in:
Matthias Seitz
2023-03-03 22:21:38 +01:00
committed by GitHub
parent 9bdbbb2b9e
commit 1bb25ae8b4
2 changed files with 3 additions and 3 deletions

View File

@ -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()
}

View File

@ -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(),