Auto merge of #109214 - tosti007:std_collection_hash_new_rework, r=workingjubilee

Use `HashMap::with_capacity_and_hasher` instead of using base

Cleans up the internal logic for `HashMap::with_capacity` slightly.
This commit is contained in:
bors 2023-10-07 05:26:12 +00:00
commit fc01a7432b

View File

@ -144,7 +144,7 @@ impl<T> HashSet<T, RandomState> {
#[must_use]
#[stable(feature = "rust1", since = "1.0.0")]
pub fn with_capacity(capacity: usize) -> HashSet<T, RandomState> {
HashSet { base: base::HashSet::with_capacity_and_hasher(capacity, Default::default()) }
HashSet::with_capacity_and_hasher(capacity, Default::default())
}
}