mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 17:24:06 +00:00
Stabilise entry_insert
Signed-off-by: Félix Saparelli <felix@passcod.name>
This commit is contained in:
parent
9c8e88b973
commit
09b0780719
@ -2450,7 +2450,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();
|
||||
@ -2459,7 +2458,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 = "1.58.0")]
|
||||
pub fn insert_entry(self, value: V) -> OccupiedEntry<'a, K, V> {
|
||||
match self {
|
||||
Occupied(mut entry) => {
|
||||
@ -2793,7 +2792,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;
|
||||
///
|
||||
@ -2805,7 +2803,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 = "1.58.0")]
|
||||
pub fn insert_entry(self, value: V) -> OccupiedEntry<'a, K, V> {
|
||||
let base = self.base.insert_entry(value);
|
||||
OccupiedEntry { base }
|
||||
|
Loading…
Reference in New Issue
Block a user