Sitelet https://github.com/mantine226/core/commit/37fa6f3370cd96b722d15d2c4a85b91e37f537ed
Skip to content

Commit 37fa6f3

Browse files
authored
feat: add Sealed::cloned (alloy-rs#860)
1 parent 6757fb3 commit 37fa6f3

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

‎crates/primitives/src/sealed.rs‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,17 @@ impl<T> Sealed<T> {
118118
}
119119
}
120120

121+
impl<T> Sealed<&T> {
122+
/// Maps a `Sealed<&T>` to a `Sealed<T>` by cloning the inner value.
123+
pub fn cloned(self) -> Sealed<T>
124+
where
125+
T: Clone,
126+
{
127+
let Self { inner, seal } = self;
128+
Sealed::new_unchecked(inner.clone(), seal)
129+
}
130+
}
131+
121132
impl<T> Default for Sealed<T>
122133
where
123134
T: Sealable + Default,

0 commit comments

Comments
 (0)