diff options
| author | bors <bors@rust-lang.org> | 2023-10-07 05:26:12 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-10-07 05:26:12 +0000 |
| commit | fc01a7432be662270467a4c3fa4a38811b621d9d (patch) | |
| tree | 8f17fc78fa41bb8231a3c4c04c520e5b14ee98b6 | |
| parent | 4ea5190026dbc1302b644d938e68bc6843cb8b24 (diff) | |
| parent | 6b98dcc743bd04bc2300655c4e800e6b1dd6f911 (diff) | |
| download | rust-fc01a7432be662270467a4c3fa4a38811b621d9d.tar.gz rust-fc01a7432be662270467a4c3fa4a38811b621d9d.zip | |
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.
| -rw-r--r-- | library/std/src/collections/hash/set.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/library/std/src/collections/hash/set.rs b/library/std/src/collections/hash/set.rs index 6d85b26af5f..6a87f6e5f2d 100644 --- a/library/std/src/collections/hash/set.rs +++ b/library/std/src/collections/hash/set.rs @@ -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()) } } |
