Use with_capacity_and_hasher instead of using base

This commit is contained in:
tosti007 2023-03-29 15:10:35 +02:00
parent cf32b9de1e
commit 6b98dcc743

View file

@ -143,7 +143,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())
}
}