Skip to content

Commit 4344de1

Browse files
committed
Auto merge of rust-lang#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.
2 parents 621aec0 + eeed6a7 commit 4344de1

File tree

1 file changed

+1
-1
lines changed
  • std/src/collections/hash

1 file changed

+1
-1
lines changed

std/src/collections/hash/set.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ impl<T> HashSet<T, RandomState> {
144144
#[must_use]
145145
#[stable(feature = "rust1", since = "1.0.0")]
146146
pub fn with_capacity(capacity: usize) -> HashSet<T, RandomState> {
147-
HashSet { base: base::HashSet::with_capacity_and_hasher(capacity, Default::default()) }
147+
HashSet::with_capacity_and_hasher(capacity, Default::default())
148148
}
149149
}
150150

0 commit comments

Comments
 (0)