Skip to content

Commit

Permalink
Expose HashMap:VacantEntry:insert_entry
Browse files Browse the repository at this point in the history
  • Loading branch information
passcod committed Oct 27, 2021
1 parent d5ec9df commit a314678
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion library/std/src/collections/hash/map.rs
Expand Up @@ -2793,6 +2793,7 @@ impl<'a, K: 'a, V: 'a> VacantEntry<'a, K, V> {
/// # Examples
///
/// ```
/// #![feature(entry_insert)]
/// use std::collections::HashMap;
/// use std::collections::hash_map::Entry;
///
Expand All @@ -2804,7 +2805,8 @@ impl<'a, K: 'a, V: 'a> VacantEntry<'a, K, V> {
/// assert_eq!(map["poneyland"], 37);
/// ```
#[inline]
fn insert_entry(self, value: V) -> OccupiedEntry<'a, K, V> {
#[unstable(feature = "entry_insert", issue = "65225")]
pub fn insert_entry(self, value: V) -> OccupiedEntry<'a, K, V> {
let base = self.base.insert_entry(value);
OccupiedEntry { base }
}
Expand Down

0 comments on commit a314678

Please sign in to comment.