Skip to content

Commit

Permalink
Auto merge of rust-lang#109214 - tosti007:std_collection_hash_new_rew…
Browse files Browse the repository at this point in the history
…ork, r=workingjubilee

Use `HashMap::with_capacity_and_hasher` instead of using base

Cleans up the internal logic for `HashMap::with_capacity` slightly.
  • Loading branch information
bors committed Oct 7, 2023
2 parents 4ea5190 + 6b98dcc commit fc01a74
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/std/src/collections/hash/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
}

Expand Down

0 comments on commit fc01a74

Please sign in to comment.