mirror of
https://github.com/fluencelabs/wasmer
synced 2024-12-13 22:25:40 +00:00
Merge #1017
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:
commit
7715be9ccb
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user