Skip to content

Commit

Permalink
Stabilize entry_insert
Browse files Browse the repository at this point in the history
  • Loading branch information
passcod committed Sep 12, 2024
1 parent 2e8db5e commit 0b2235d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions library/std/src/collections/hash/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2754,7 +2754,6 @@ impl<'a, K, V> Entry<'a, K, V> {
/// # Examples
///
/// ```
/// #![feature(entry_insert)]
/// use std::collections::HashMap;
///
/// let mut map: HashMap<&str, String> = HashMap::new();
Expand All @@ -2763,7 +2762,7 @@ impl<'a, K, V> Entry<'a, K, V> {
/// assert_eq!(entry.key(), &"poneyland");
/// ```
#[inline]
#[unstable(feature = "entry_insert", issue = "65225")]
#[stable(feature = "entry_insert", since = "CURRENT_RUSTC_VERSION")]
pub fn insert_entry(self, value: V) -> OccupiedEntry<'a, K, V> {
match self {
Occupied(mut entry) => {
Expand Down Expand Up @@ -3097,7 +3096,6 @@ 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 @@ -3109,7 +3107,7 @@ impl<'a, K: 'a, V: 'a> VacantEntry<'a, K, V> {
/// assert_eq!(map["poneyland"], 37);
/// ```
#[inline]
#[unstable(feature = "entry_insert", issue = "65225")]
#[stable(feature = "entry_insert", since = "CURRENT_RUSTC_VERSION")]
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 0b2235d

Please sign in to comment.