Skip to content

Commit c8fbb11

Browse files
committed
Add Default trait implementation
1 parent 502519c commit c8fbb11

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/lib.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,18 @@ impl<K1: Eq + Hash + Debug, K2: Eq + Hash + Debug, V: Debug> fmt::Debug for Mult
246246
}
247247
}
248248

249+
impl<K1, K2, V> Default for MultiMap<K1, K2, V>
250+
where
251+
K1: Eq + Hash + Clone,
252+
K2: Eq + Hash + Clone,
253+
{
254+
/// Creates an empty `MultiMap<K1, K2, V>`.
255+
#[inline]
256+
fn default() -> MultiMap<K1, K2, V> {
257+
MultiMap::new()
258+
}
259+
}
260+
249261
#[macro_export]
250262
/// Create a `MultiMap` from a list of key-value tuples
251263
///

0 commit comments

Comments
 (0)