From deae8c6a64d79039800489b38e5aa0b8c24f5520 Mon Sep 17 00:00:00 2001 From: Emilia Hane Date: Sat, 5 Oct 2024 11:02:13 +0200 Subject: [PATCH] feat: add `Default` for `Sealed` (#755) * Derive Default for Sealed * Manual impl Default for Sealed --- crates/primitives/src/sealed.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/crates/primitives/src/sealed.rs b/crates/primitives/src/sealed.rs index 708c52cfc..232bc6baa 100644 --- a/crates/primitives/src/sealed.rs +++ b/crates/primitives/src/sealed.rs @@ -63,6 +63,15 @@ impl Sealed { } } +impl Default for Sealed +where + T: Sealable + Default, +{ + fn default() -> Self { + T::default().seal_slow() + } +} + #[cfg(feature = "arbitrary")] impl<'a, T> arbitrary::Arbitrary<'a> for Sealed where