1
- use core:: { ops:: { Range , RangeBounds } , ptr, slice} ;
1
+ use core:: ops:: { Range , RangeBounds } ;
2
+ use core:: { ptr, slice} ;
2
3
3
4
use super :: Vec ;
4
5
use crate :: alloc:: { Allocator , Global } ;
@@ -24,9 +25,7 @@ pub struct ExtractIf<
24
25
T ,
25
26
F ,
26
27
#[ unstable( feature = "allocator_api" , issue = "32838" ) ] A : Allocator = Global ,
27
- > where
28
- F : FnMut ( & mut T ) -> bool ,
29
- {
28
+ > {
30
29
pub ( super ) vec : & ' a mut Vec < T , A > ,
31
30
/// The index of the item that will be inspected by the next call to `next`.
32
31
pub ( super ) idx : usize ,
@@ -40,10 +39,7 @@ pub struct ExtractIf<
40
39
pub ( super ) pred : F ,
41
40
}
42
41
43
- impl < ' a , T , F , A : Allocator > ExtractIf < ' a , T , F , A >
44
- where
45
- F : FnMut ( & mut T ) -> bool ,
46
- {
42
+ impl < ' a , T , F , A : Allocator > ExtractIf < ' a , T , F , A > {
47
43
pub ( super ) fn new < R : RangeBounds < usize > > ( vec : & ' a mut Vec < T , A > , pred : F , range : R ) -> Self {
48
44
let old_len = vec. len ( ) ;
49
45
let Range { start, end } = slice:: range ( range, ..old_len) ;
@@ -100,10 +96,7 @@ where
100
96
}
101
97
102
98
#[ unstable( feature = "extract_if" , reason = "recently added" , issue = "43244" ) ]
103
- impl < T , F , A : Allocator > Drop for ExtractIf < ' _ , T , F , A >
104
- where
105
- F : FnMut ( & mut T ) -> bool ,
106
- {
99
+ impl < T , F , A : Allocator > Drop for ExtractIf < ' _ , T , F , A > {
107
100
fn drop ( & mut self ) {
108
101
unsafe {
109
102
if self . idx < self . old_len && self . del > 0 {
0 commit comments