Destabilise entry_insert
This commit is contained in:
parent
30b3f35c42
commit
319dd150fc
@ -2472,6 +2472,7 @@ impl<'a, K, V> Entry<'a, K, V> {
|
|||||||
/// # 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();
|
||||||
@ -2480,7 +2481,7 @@ impl<'a, K, V> Entry<'a, K, V> {
|
|||||||
/// assert_eq!(entry.key(), &"poneyland");
|
/// assert_eq!(entry.key(), &"poneyland");
|
||||||
/// ```
|
/// ```
|
||||||
#[inline]
|
#[inline]
|
||||||
#[stable(feature = "entry_insert", since = "1.59.0")]
|
#[unstable(feature = "entry_insert", issue = "65225")]
|
||||||
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) => {
|
||||||
@ -2814,6 +2815,7 @@ impl<'a, K: 'a, V: 'a> VacantEntry<'a, K, 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;
|
||||||
///
|
///
|
||||||
@ -2825,7 +2827,7 @@ impl<'a, K: 'a, V: 'a> VacantEntry<'a, K, V> {
|
|||||||
/// assert_eq!(map["poneyland"], 37);
|
/// assert_eq!(map["poneyland"], 37);
|
||||||
/// ```
|
/// ```
|
||||||
#[inline]
|
#[inline]
|
||||||
#[stable(feature = "entry_insert", since = "1.59.0")]
|
#[unstable(feature = "entry_insert", issue = "65225")]
|
||||||
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 }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user