Skip to content

Commit cf67c9b

Browse files
authored
Rollup merge of #84121 - workingjubilee:stabilize-btree-retain, r=dtolnay
Stabilize BTree{Map,Set}::retain Closes #79025. FCP concluded here: #79025 (comment) 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 #79026 and doesn't seem to have caused any problems since.
2 parents 3d6a364 + 7baeaa9 commit cf67c9b

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

library/alloc/src/collections/btree/map.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -940,7 +940,6 @@ impl<K, V> BTreeMap<K, V> {
940940
/// # Examples
941941
///
942942
/// ```
943-
/// #![feature(btree_retain)]
944943
/// use std::collections::BTreeMap;
945944
///
946945
/// let mut map: BTreeMap<i32, i32> = (0..8).map(|x| (x, x*10)).collect();
@@ -949,7 +948,7 @@ impl<K, V> BTreeMap<K, V> {
949948
/// assert!(map.into_iter().eq(vec![(0, 0), (2, 20), (4, 40), (6, 60)]));
950949
/// ```
951950
#[inline]
952-
#[unstable(feature = "btree_retain", issue = "79025")]
951+
#[stable(feature = "btree_retain", since = "1.53.0")]
953952
pub fn retain<F>(&mut self, mut f: F)
954953
where
955954
K: Ord,

library/alloc/src/collections/btree/set.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,6 @@ impl<T> BTreeSet<T> {
851851
/// # Examples
852852
///
853853
/// ```
854-
/// #![feature(btree_retain)]
855854
/// use std::collections::BTreeSet;
856855
///
857856
/// let xs = [1, 2, 3, 4, 5, 6];
@@ -860,7 +859,7 @@ impl<T> BTreeSet<T> {
860859
/// set.retain(|&k| k % 2 == 0);
861860
/// assert!(set.iter().eq([2, 4, 6].iter()));
862861
/// ```
863-
#[unstable(feature = "btree_retain", issue = "79025")]
862+
#[stable(feature = "btree_retain", since = "1.53.0")]
864863
pub fn retain<F>(&mut self, mut f: F)
865864
where
866865
T: Ord,

0 commit comments

Comments
 (0)