Skip to content

Commit

Permalink
feat: add Default for Sealed<T> (#755)
Browse files Browse the repository at this point in the history
* Derive Default for Sealed<T>

* Manual impl Default for Sealed<T>
  • Loading branch information
emhane authored Oct 5, 2024
1 parent 7990e54 commit deae8c6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions crates/primitives/src/sealed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,15 @@ impl<T> Sealed<T> {
}
}

impl<T> Default for Sealed<T>
where
T: Sealable + Default,
{
fn default() -> Self {
T::default().seal_slow()
}
}

#[cfg(feature = "arbitrary")]
impl<'a, T> arbitrary::Arbitrary<'a> for Sealed<T>
where
Expand Down

0 comments on commit deae8c6

Please sign in to comment.