about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-10-07 05:26:12 +0000
committerbors <bors@rust-lang.org>2023-10-07 05:26:12 +0000
commitfc01a7432be662270467a4c3fa4a38811b621d9d (patch)
tree8f17fc78fa41bb8231a3c4c04c520e5b14ee98b6
parent4ea5190026dbc1302b644d938e68bc6843cb8b24 (diff)
parent6b98dcc743bd04bc2300655c4e800e6b1dd6f911 (diff)
downloadrust-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.rs2
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())
     }
 }