mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-24 00:58:00 +01:00
Rollup merge of #133257 - GuillaumeGomez:unordmap-clear, r=lcnr
Add `UnordMap::clear` method I need it for something I'm working on and I was surprised to see this method was not implemented.
This commit is contained in:
commit
71d07dd030
@ -602,6 +602,11 @@ impl<K: Eq + Hash, V> UnordMap<K, V> {
|
||||
.into_iter()
|
||||
.map(|(_, v)| v)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn clear(&mut self) {
|
||||
self.inner.clear()
|
||||
}
|
||||
}
|
||||
|
||||
impl<K, Q: ?Sized, V> Index<&Q> for UnordMap<K, V>
|
||||
|
Loading…
Reference in New Issue
Block a user