@@ -1003,7 +1003,7 @@ where
1003
1003
/// match singles.entry(ch) {
1004
1004
/// Vacant(single_entry) => {
1005
1005
/// // We found a new character for the first time.
1006
- /// single_entry.insert();
1006
+ /// single_entry.insert()
1007
1007
/// }
1008
1008
/// Occupied(single_entry) => {
1009
1009
/// // We've already seen this once, "move" it to dupes.
@@ -2211,7 +2211,7 @@ impl<T: fmt::Debug, S, A: Allocator> fmt::Debug for OccupiedEntry<'_, T, S, A> {
2211
2211
///
2212
2212
/// // Nonexistent key (insert)
2213
2213
/// match set.entry("b") {
2214
- /// Entry::Vacant(view) => { view.insert(); } ,
2214
+ /// Entry::Vacant(view) => view.insert(),
2215
2215
/// Entry::Occupied(_) => unreachable!(),
2216
2216
/// }
2217
2217
/// assert!(set.contains("b") && set.len() == 2);
@@ -2247,7 +2247,7 @@ impl<'a, T, S, A: Allocator> Entry<'a, T, S, A> {
2247
2247
{
2248
2248
match self {
2249
2249
Entry :: Occupied ( entry) => entry,
2250
- Entry :: Vacant ( entry) => entry. insert ( ) ,
2250
+ Entry :: Vacant ( entry) => entry. insert_entry ( ) ,
2251
2251
}
2252
2252
}
2253
2253
@@ -2442,7 +2442,16 @@ impl<'a, T, S, A: Allocator> VacantEntry<'a, T, S, A> {
2442
2442
/// assert!(set.contains("poneyland"));
2443
2443
/// ```
2444
2444
#[ cfg_attr( feature = "inline-more" , inline) ]
2445
- pub fn insert ( self ) -> OccupiedEntry < ' a , T , S , A >
2445
+ pub fn insert ( self )
2446
+ where
2447
+ T : Hash ,
2448
+ S : BuildHasher ,
2449
+ {
2450
+ self . inner . insert ( ( ) ) ;
2451
+ }
2452
+
2453
+ #[ cfg_attr( feature = "inline-more" , inline) ]
2454
+ fn insert_entry ( self ) -> OccupiedEntry < ' a , T , S , A >
2446
2455
where
2447
2456
T : Hash ,
2448
2457
S : BuildHasher ,
0 commit comments