Skip to content

Commit 71d07dd

Browse files
authored
Rollup merge of rust-lang#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.
2 parents 1099bc8 + 186e282 commit 71d07dd

File tree

1 file changed

+5
-0
lines changed
  • compiler/rustc_data_structures/src

1 file changed

+5
-0
lines changed

compiler/rustc_data_structures/src/unord.rs

+5
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,11 @@ impl<K: Eq + Hash, V> UnordMap<K, V> {
602602
.into_iter()
603603
.map(|(_, v)| v)
604604
}
605+
606+
#[inline]
607+
pub fn clear(&mut self) {
608+
self.inner.clear()
609+
}
605610
}
606611

607612
impl<K, Q: ?Sized, V> Index<&Q> for UnordMap<K, V>

0 commit comments

Comments
 (0)