diff --git a/phf/src/map.rs b/phf/src/map.rs index 5b74445c..9fc42df9 100644 --- a/phf/src/map.rs +++ b/phf/src/map.rs @@ -46,7 +46,23 @@ where } } +impl Default for Map { + fn default() -> Self { + Self::new() + } +} + impl Map { + /// Create a new, empty, immutable map. + #[inline] + pub const fn new() -> Self { + Self { + key: 0, + disps: &[], + entries: &[], + } + } + /// Returns the number of entries in the `Map`. #[inline] pub const fn len(&self) -> usize {