1- use core:: { ops:: { Range , RangeBounds } , ptr, slice} ;
1+ use core:: ops:: { Range , RangeBounds } ;
2+ use core:: { ptr, slice} ;
23
34use super :: Vec ;
45use crate :: alloc:: { Allocator , Global } ;
@@ -24,9 +25,7 @@ pub struct ExtractIf<
2425 T ,
2526 F ,
2627 #[ unstable( feature = "allocator_api" , issue = "32838" ) ] A : Allocator = Global ,
27- > where
28- F : FnMut ( & mut T ) -> bool ,
29- {
28+ > {
3029 pub ( super ) vec : & ' a mut Vec < T , A > ,
3130 /// The index of the item that will be inspected by the next call to `next`.
3231 pub ( super ) idx : usize ,
@@ -40,10 +39,7 @@ pub struct ExtractIf<
4039 pub ( super ) pred : F ,
4140}
4241
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 > {
4743 pub ( super ) fn new < R : RangeBounds < usize > > ( vec : & ' a mut Vec < T , A > , pred : F , range : R ) -> Self {
4844 let old_len = vec. len ( ) ;
4945 let Range { start, end } = slice:: range ( range, ..old_len) ;
@@ -100,10 +96,7 @@ where
10096}
10197
10298#[ 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 > {
107100 fn drop ( & mut self ) {
108101 unsafe {
109102 if self . idx < self . old_len && self . del > 0 {
0 commit comments