1
Fork 0

Auto merge of #120931 - chenyukang:yukang-cleanup-hashmap, r=michaelwoerister

Clean up potential_query_instability with FxIndexMap and UnordMap

From https://github.com/rust-lang/rust/pull/120485#issuecomment-1916437191

r? `@michaelwoerister`
This commit is contained in:
bors 2024-02-15 12:36:37 +00:00
commit fa9f77ff35
30 changed files with 122 additions and 139 deletions

View file

@ -524,6 +524,11 @@ impl<K: Eq + Hash, V> UnordMap<K, V> {
UnordItems(self.inner.into_iter())
}
#[inline]
pub fn keys(&self) -> UnordItems<&K, impl Iterator<Item = &K>> {
UnordItems(self.inner.keys())
}
/// Returns the entries of this map in stable sort order (as defined by `ToStableHashKey`).
///
/// The `cache_sort_key` parameter controls if [slice::sort_by_cached_key] or