@@ -1201,30 +1201,30 @@ impl<T, A: Allocator + Clone> BTreeSet<T, A> {
1201
1201
/// [`retain`]: BTreeSet::retain
1202
1202
/// # Examples
1203
1203
///
1204
- /// Splitting a set into even and odd values, reusing the original set:
1205
- ///
1206
1204
/// ```
1207
1205
/// #![feature(btree_extract_if)]
1208
1206
/// use std::collections::BTreeSet;
1209
1207
///
1208
+ /// // Splitting a set into even and odd values, reusing the original set:
1210
1209
/// let mut set: BTreeSet<i32> = (0..8).collect();
1211
1210
/// let evens: BTreeSet<_> = set.extract_if(.., |v| v % 2 == 0).collect();
1212
1211
/// let odds = set;
1213
1212
/// assert_eq!(evens.into_iter().collect::<Vec<_>>(), vec![0, 2, 4, 6]);
1214
1213
/// assert_eq!(odds.into_iter().collect::<Vec<_>>(), vec![1, 3, 5, 7]);
1215
1214
///
1216
- /// let mut map: BTreeSet<i32> = (0..8).collect();
1217
- /// let low: BTreeSet<_> = map.extract_if(0..4, |_v| true).collect();
1218
- /// let high = map;
1215
+ /// // Splitting a set into low and high halves, reusing the original set:
1216
+ /// let mut set: BTreeSet<i32> = (0..8).collect();
1217
+ /// let low: BTreeSet<_> = set.extract_if(0..4, |_v| true).collect();
1218
+ /// let high = set;
1219
1219
/// assert_eq!(low.into_iter().collect::<Vec<_>>(), [0, 1, 2, 3]);
1220
1220
/// assert_eq!(high.into_iter().collect::<Vec<_>>(), [4, 5, 6, 7]);
1221
1221
/// ```
1222
1222
#[ unstable( feature = "btree_extract_if" , issue = "70530" ) ]
1223
- pub fn extract_if < ' a , F , R > ( & ' a mut self , range : R , pred : F ) -> ExtractIf < ' a , T , R , F , A >
1223
+ pub fn extract_if < F , R > ( & mut self , range : R , pred : F ) -> ExtractIf < ' _ , T , R , F , A >
1224
1224
where
1225
1225
T : Ord ,
1226
1226
R : RangeBounds < T > ,
1227
- F : ' a + FnMut ( & T ) -> bool ,
1227
+ F : FnMut ( & T ) -> bool ,
1228
1228
{
1229
1229
let ( inner, alloc) = self . map . extract_if_inner ( range) ;
1230
1230
ExtractIf { pred, inner, alloc }
@@ -1585,11 +1585,11 @@ where
1585
1585
}
1586
1586
1587
1587
#[ unstable( feature = "btree_extract_if" , issue = "70530" ) ]
1588
- impl < ' a , T , R , F , A : Allocator + Clone > Iterator for ExtractIf < ' _ , T , R , F , A >
1588
+ impl < T , R , F , A : Allocator + Clone > Iterator for ExtractIf < ' _ , T , R , F , A >
1589
1589
where
1590
1590
T : PartialOrd ,
1591
1591
R : RangeBounds < T > ,
1592
- F : ' a + FnMut ( & T ) -> bool ,
1592
+ F : FnMut ( & T ) -> bool ,
1593
1593
{
1594
1594
type Item = T ;
1595
1595
0 commit comments