diff --git a/crates/primitives-traits/src/header/sealed.rs b/crates/primitives-traits/src/header/sealed.rs index c7a61f253206..0cae46d3b441 100644 --- a/crates/primitives-traits/src/header/sealed.rs +++ b/crates/primitives-traits/src/header/sealed.rs @@ -96,14 +96,16 @@ impl SealedHeader { let hash = self.hash(); (self.header, hash) } +} - /// Clones the header and returns a new sealed header. - pub fn cloned(self) -> Self +impl SealedHeader<&H> { + /// Maps a `SealedHeader<&H>` to a `SealedHeader` by cloning the header. + pub fn cloned(self) -> SealedHeader where H: Clone, { - let (header, hash) = self.split(); - Self::new(header, hash) + let Self { hash, header } = self; + SealedHeader { hash, header: header.clone() } } }