Skip to content

Commit a314678

Browse files
committed
Expose HashMap:VacantEntry:insert_entry
1 parent d5ec9df commit a314678

File tree

1 file changed

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

1 file changed

+3
-1
lines changed

library/std/src/collections/hash/map.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2793,6 +2793,7 @@ impl<'a, K: 'a, V: 'a> VacantEntry<'a, K, V> {
27932793
/// # Examples
27942794
///
27952795
/// ```
2796+
/// #![feature(entry_insert)]
27962797
/// use std::collections::HashMap;
27972798
/// use std::collections::hash_map::Entry;
27982799
///
@@ -2804,7 +2805,8 @@ impl<'a, K: 'a, V: 'a> VacantEntry<'a, K, V> {
28042805
/// assert_eq!(map["poneyland"], 37);
28052806
/// ```
28062807
#[inline]
2807-
fn insert_entry(self, value: V) -> OccupiedEntry<'a, K, V> {
2808+
#[unstable(feature = "entry_insert", issue = "65225")]
2809+
pub fn insert_entry(self, value: V) -> OccupiedEntry<'a, K, V> {
28082810
let base = self.base.insert_entry(value);
28092811
OccupiedEntry { base }
28102812
}

0 commit comments

Comments
 (0)