diff --git a/CHANGELOG.md b/CHANGELOG.md index a7a5fdb922..5d127a5608 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## Added - Added safe `try_insert_no_grow` method to `RawTable`. (#229) +- Implemented `Default` for `RawTable`. (#237) ## Changed - The minimum Rust version has been bumped to 1.49.0. (#230) diff --git a/src/raw/mod.rs b/src/raw/mod.rs index f5f8322243..24e7f13706 100644 --- a/src/raw/mod.rs +++ b/src/raw/mod.rs @@ -1587,6 +1587,13 @@ impl RawTable { } } +impl Default for RawTable { + #[cfg_attr(feature = "inline-more", inline)] + fn default() -> Self { + Self::new_in(Default::default()) + } +} + #[cfg(feature = "nightly")] unsafe impl<#[may_dangle] T, A: Allocator + Clone> Drop for RawTable { #[cfg_attr(feature = "inline-more", inline)]