1017: Add a 'clear' method to map. r=nlewycky a=nlewycky

# Description
Motivated by work on the `nlewycky/inkwell-lifetimes` branch. No callers yet on master, but we use it on the branch and I'd like to merge in pieces.


Co-authored-by: Nick Lewycky <nick@wasmer.io>
This commit is contained in:
bors[bot] 2019-11-25 22:54:12 +00:00 committed by GitHub
commit 7715be9ccb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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()