Closed
Description
std::oldmap::HashMap now takes &mut self:
impl<K: Eq IterBytes Hash, V> T<K, V>: Mutable {
fn clear(&mut self) {
self.count = 0u;
self.chains = chains(initial_capacity);
}
}
I am finding this rather awkward because HashMap also has methods like insert and remove that do not take mutable self, but are also non-pure. What this means is that I can't make my field of type std::oldmap::HashMap mut, because then rustc complains about illegal borrow unless pure
when calling insert/remove, and I can't make it non-mut because then I can't call clear on it...
Does it make sense for HashMap to implement Mutable? AFAICT HashMap doesn't need mutable self because it mutates by changing its internal fields, not by creating a new instance of itself.
Metadata
Metadata
Assignees
Labels
No labels