We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b0b1d9d commit b63dc2aCopy full SHA for b63dc2a
crates/primitives-traits/src/header/sealed.rs
@@ -96,14 +96,16 @@ impl<H: Sealable> SealedHeader<H> {
96
let hash = self.hash();
97
(self.header, hash)
98
}
99
+}
100
- /// Clones the header and returns a new sealed header.
101
- pub fn cloned(self) -> Self
+impl<H: Sealable> SealedHeader<&H> {
102
+ /// Maps a `SealedHeader<&H>` to a `SealedHeader<H>` by cloning the header.
103
+ pub fn cloned(self) -> SealedHeader<H>
104
where
105
H: Clone,
106
{
- let (header, hash) = self.split();
- Self::new(header, hash)
107
+ let Self { hash, header } = self;
108
+ SealedHeader { hash, header: header.clone() }
109
110
111
0 commit comments