chore: move SealedHeader::cloned to &H (#13904)

This commit is contained in:
Matthias Seitz
2025-01-21 16:49:10 +01:00
committed by GitHub
parent b0b1d9d8df
commit b63dc2ad89

View File

@ -96,14 +96,16 @@ impl<H: Sealable> SealedHeader<H> {
let hash = self.hash();
(self.header, hash)
}
}
/// Clones the header and returns a new sealed header.
pub fn cloned(self) -> Self
impl<H: Sealable> SealedHeader<&H> {
/// Maps a `SealedHeader<&H>` to a `SealedHeader<H>` by cloning the header.
pub fn cloned(self) -> SealedHeader<H>
where
H: Clone,
{
let (header, hash) = self.split();
Self::new(header, hash)
let Self { hash, header } = self;
SealedHeader { hash, header: header.clone() }
}
}