Skip to content

Commit

Permalink
Unrolled build for rust-lang#133257
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rust-timer authored Nov 21, 2024
2 parents 3fee0f1 + 186e282 commit 0964e85
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions compiler/rustc_data_structures/src/unord.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 0964e85

Please sign in to comment.