diff --git a/Cargo.toml b/Cargo.toml index 6a0f3dd..c1b10a2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "jsonmap" -version = "0.1.1" +version = "0.1.2" edition = "2018" license = "GPL-3.0-or-later" authors = ["wandercn"] diff --git a/src/map.rs b/src/map.rs index 164f956..8f26749 100644 --- a/src/map.rs +++ b/src/map.rs @@ -95,6 +95,17 @@ where } } +impl Default for JsonMap +where + K: Eq + Clone + Hash, +{ + fn default() -> Self { + Self { + inner: HashMap::new(), + } + } +} + impl FromIterator<(K, JsonV)> for JsonMap where K: Eq + Clone + Hash,