Skip to content

Commit

Permalink
impl Default trait
Browse files Browse the repository at this point in the history
  • Loading branch information
wander committed Jul 18, 2024
1 parent 2294466 commit 9e8c6e1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -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<[email protected]>"]
Expand Down
11 changes: 11 additions & 0 deletions src/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,17 @@ where
}
}

impl<K> Default for JsonMap<K>
where
K: Eq + Clone + Hash,
{
fn default() -> Self {
Self {
inner: HashMap::new(),
}
}
}

impl<K> FromIterator<(K, JsonV<K>)> for JsonMap<K>
where
K: Eq + Clone + Hash,
Expand Down

0 comments on commit 9e8c6e1

Please sign in to comment.