From 56e030a2903f65bbd43688c24e02774554611bc3 Mon Sep 17 00:00:00 2001 From: Timo von Holtz Date: Wed, 11 Apr 2018 20:36:06 +0200 Subject: [PATCH] Allow any default BuildHasher in ConcHashMap::new() Fixes #8 --- src/map.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/map.rs b/src/map.rs index 5116815..a2745c2 100644 --- a/src/map.rs +++ b/src/map.rs @@ -27,12 +27,14 @@ pub struct ConcHashMap where K: Send + Sync, V: Send + Sync } impl ConcHashMap - where K: Hash + Eq + Send + Sync, V: Send + Sync, H: BuildHasher { - + where K: Hash + Eq + Send + Sync, V: Send + Sync, H: BuildHasher + Default { /// Creates a new hashmap using default options. - pub fn new() -> ConcHashMap { + pub fn new() -> ConcHashMap { Default::default() } +} +impl ConcHashMap + where K: Hash + Eq + Send + Sync, V: Send + Sync, H: BuildHasher { /// Creates a new hashmap with custom options. pub fn with_options(opts: Options) -> ConcHashMap {