Add a 'clear' method to map.

This commit is contained in:
Nick Lewycky 2019-11-25 14:46:16 -08:00
parent 5c1c786e35
commit 4e2440daec

View File

@ -37,6 +37,11 @@ where
}
}
/// Clears the map. Keeps the allocated memory for future use.
pub fn clear(&mut self) {
self.elems.clear();
}
/// Returns the size of this map.
pub fn len(&self) -> usize {
self.elems.len()