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