Stabilize entry_insert

This commit is contained in:
Félix Saparelli 2024-09-13 10:29:01 +12:00
parent 2e8db5e9e3
commit 0b2235d732
No known key found for this signature in database

View File

@ -2754,7 +2754,6 @@ pub fn and_modify<F>(self, f: F) -> Self
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(entry_insert)]
/// use std::collections::HashMap; /// use std::collections::HashMap;
/// ///
/// let mut map: HashMap<&str, String> = HashMap::new(); /// let mut map: HashMap<&str, String> = HashMap::new();
@ -2763,7 +2762,7 @@ pub fn and_modify<F>(self, f: F) -> Self
/// assert_eq!(entry.key(), &"poneyland"); /// assert_eq!(entry.key(), &"poneyland");
/// ``` /// ```
#[inline] #[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> { pub fn insert_entry(self, value: V) -> OccupiedEntry<'a, K, V> {
match self { match self {
Occupied(mut entry) => { Occupied(mut entry) => {
@ -3097,7 +3096,6 @@ pub fn insert(self, value: V) -> &'a mut V {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(entry_insert)]
/// use std::collections::HashMap; /// use std::collections::HashMap;
/// use std::collections::hash_map::Entry; /// use std::collections::hash_map::Entry;
/// ///
@ -3109,7 +3107,7 @@ pub fn insert(self, value: V) -> &'a mut V {
/// assert_eq!(map["poneyland"], 37); /// assert_eq!(map["poneyland"], 37);
/// ``` /// ```
#[inline] #[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> { pub fn insert_entry(self, value: V) -> OccupiedEntry<'a, K, V> {
let base = self.base.insert_entry(value); let base = self.base.insert_entry(value);
OccupiedEntry { base } OccupiedEntry { base }