Expose HashMap:VacantEntry:insert_entry
This commit is contained in:
parent
d5ec9dfa5c
commit
a314678639
1 changed files with 3 additions and 1 deletions
|
@ -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;
|
||||
///
|
||||
|
@ -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 }
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue