diff options
| author | Chai T. Rex <ChaiTRex@users.noreply.github.com> | 2020-10-18 15:45:09 -0400 |
|---|---|---|
| committer | Chai T. Rex <ChaiTRex@users.noreply.github.com> | 2020-10-18 15:45:09 -0400 |
| commit | c2de8fe29443d8c9c70da66dee2c99d4c8d04930 (patch) | |
| tree | 626683e48816059c6b02c3d9e06cdccea2cfa2b7 /library/alloc/src | |
| parent | 98e16884b10630e6e6ef5f4a076af3409122401d (diff) | |
| download | rust-c2de8fe29443d8c9c70da66dee2c99d4c8d04930.tar.gz rust-c2de8fe29443d8c9c70da66dee2c99d4c8d04930.zip | |
Stabilize or_insert_with_key
Diffstat (limited to 'library/alloc/src')
| -rw-r--r-- | library/alloc/src/collections/btree/map/entry.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/library/alloc/src/collections/btree/map/entry.rs b/library/alloc/src/collections/btree/map/entry.rs index 73a0ca21f67..3ff648fe24c 100644 --- a/library/alloc/src/collections/btree/map/entry.rs +++ b/library/alloc/src/collections/btree/map/entry.rs @@ -116,7 +116,6 @@ impl<'a, K: Ord, V> Entry<'a, K, V> { } } - #[unstable(feature = "or_insert_with_key", issue = "71024")] /// Ensures a value is in the entry by inserting, if empty, the result of the default function, /// which takes the key as its argument, and returns a mutable reference to the value in the /// entry. @@ -124,7 +123,6 @@ impl<'a, K: Ord, V> Entry<'a, K, V> { /// # Examples /// /// ``` - /// #![feature(or_insert_with_key)] /// use std::collections::BTreeMap; /// /// let mut map: BTreeMap<&str, usize> = BTreeMap::new(); @@ -134,6 +132,7 @@ impl<'a, K: Ord, V> Entry<'a, K, V> { /// assert_eq!(map["poneyland"], 9); /// ``` #[inline] + #[stable(feature = "or_insert_with_key", since = "1.49.0")] pub fn or_insert_with_key<F: FnOnce(&K) -> V>(self, default: F) -> &'a mut V { match self { Occupied(entry) => entry.into_mut(), |
