Skip to content

A lightweight WebAssembly runtime that is fast, secure, and standards-compliant

Implement `Default` for `wasmtime_environ::collections::HashSet` (#12518)

Nick Fitzgerald10ce58c89705
diff --git a/crates/environ/src/collections/hash_set.rs b/crates/environ/src/collections/hash_set.rs
index 5032d06d9c..9dc2806535 100644
--- a/crates/environ/src/collections/hash_set.rs
+++ b/crates/environ/src/collections/hash_set.rs
@@ -17,6 +17,17 @@ pub struct HashSet<T, S = DefaultHashBuilder> {
inner: inner::HashSet<T, S>,
}
+impl<T, S> Default for HashSet<T, S>
+where
+ S: Default,
+{
+ fn default() -> Self {
+ Self {
+ inner: inner::HashSet::default(),
+ }
+ }
+}
+
impl<T, S> PartialEq for HashSet<T, S>
where
T: Eq + Hash,