diff options
| author | Dylan DPC <dylan.dpc@gmail.com> | 2021-04-13 11:10:42 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-13 11:10:42 +0200 |
| commit | cf67c9bbf79d7f94af2a361fda666426e5e8d400 (patch) | |
| tree | e073e32ee22ba976405cae00981e1643bf1d1826 | |
| parent | 3d6a364e33aee66a3126f33e4e9d7157c1b0740d (diff) | |
| parent | 7baeaa95e274662b248428b738fd57e6e9f1a97d (diff) | |
| download | rust-cf67c9bbf79d7f94af2a361fda666426e5e8d400.tar.gz rust-cf67c9bbf79d7f94af2a361fda666426e5e8d400.zip | |
Rollup merge of #84121 - workingjubilee:stabilize-btree-retain, r=dtolnay
Stabilize BTree{Map,Set}::retain
Closes #79025.
FCP concluded here: https://github.com/rust-lang/rust/issues/79025#issuecomment-817201302
This is an approved feature on BTree{Map,Set} to mirror a functionality in Hash{Map,Set}, which has had some adequate testing since its introduction in https://github.com/rust-lang/rust/pull/79026 and doesn't seem to have caused any problems since.
| -rw-r--r-- | library/alloc/src/collections/btree/map.rs | 3 | ||||
| -rw-r--r-- | library/alloc/src/collections/btree/set.rs | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/library/alloc/src/collections/btree/map.rs b/library/alloc/src/collections/btree/map.rs index a0dbb289252..971244718b4 100644 --- a/library/alloc/src/collections/btree/map.rs +++ b/library/alloc/src/collections/btree/map.rs @@ -940,7 +940,6 @@ impl<K, V> BTreeMap<K, V> { /// # Examples /// /// ``` - /// #![feature(btree_retain)] /// use std::collections::BTreeMap; /// /// let mut map: BTreeMap<i32, i32> = (0..8).map(|x| (x, x*10)).collect(); @@ -949,7 +948,7 @@ impl<K, V> BTreeMap<K, V> { /// assert!(map.into_iter().eq(vec![(0, 0), (2, 20), (4, 40), (6, 60)])); /// ``` #[inline] - #[unstable(feature = "btree_retain", issue = "79025")] + #[stable(feature = "btree_retain", since = "1.53.0")] pub fn retain<F>(&mut self, mut f: F) where K: Ord, diff --git a/library/alloc/src/collections/btree/set.rs b/library/alloc/src/collections/btree/set.rs index a331b8d8e4b..737932d931c 100644 --- a/library/alloc/src/collections/btree/set.rs +++ b/library/alloc/src/collections/btree/set.rs @@ -851,7 +851,6 @@ impl<T> BTreeSet<T> { /// # Examples /// /// ``` - /// #![feature(btree_retain)] /// use std::collections::BTreeSet; /// /// let xs = [1, 2, 3, 4, 5, 6]; @@ -860,7 +859,7 @@ impl<T> BTreeSet<T> { /// set.retain(|&k| k % 2 == 0); /// assert!(set.iter().eq([2, 4, 6].iter())); /// ``` - #[unstable(feature = "btree_retain", issue = "79025")] + #[stable(feature = "btree_retain", since = "1.53.0")] pub fn retain<F>(&mut self, mut f: F) where T: Ord, |
