Skip to content

Commit fc01a74

Browse files
committed
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.
2 parents 4ea5190 + 6b98dcc commit fc01a74

File tree

1 file changed

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

1 file changed

+1
-1
lines changed

library/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)