From da2cbaf3b094856eff00c5153e67016c2a8b4a6d Mon Sep 17 00:00:00 2001 From: Cole Miller Date: Sat, 13 Feb 2021 22:35:37 -0500 Subject: [PATCH 1/2] Implement `Default` for `RawTable` --- src/raw/mod.rs | 7 +++++++ 1 file changed, 7 insertions(+) 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)] From f9a46e544dce322cc3bc8419e3df408179ebe537 Mon Sep 17 00:00:00 2001 From: Cole Miller Date: Sat, 13 Feb 2021 22:35:53 -0500 Subject: [PATCH 2/2] Changelog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) 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)