mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 23:34:48 +00:00
Stabilize BTree{Map,Set}::retain
This commit is contained in:
parent
e41f378f82
commit
7baeaa95e2
@ -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,
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user