1
+ use crate :: alloc:: { Allocator , Global } ;
1
2
use core:: ptr:: { self } ;
2
3
use core:: slice:: { self } ;
3
- use crate :: alloc:: { Allocator , Global } ;
4
4
5
- use super :: { Vec } ;
5
+ use super :: Vec ;
6
6
7
7
/// An iterator which uses a closure to determine if an element should be removed.
8
8
///
@@ -45,8 +45,8 @@ pub struct DrainFilter<
45
45
}
46
46
47
47
impl < T , F , A : Allocator > DrainFilter < ' _ , T , F , A >
48
- where
49
- F : FnMut ( & mut T ) -> bool ,
48
+ where
49
+ F : FnMut ( & mut T ) -> bool ,
50
50
{
51
51
/// Returns a reference to the underlying allocator.
52
52
#[ unstable( feature = "allocator_api" , issue = "32838" ) ]
@@ -58,8 +58,8 @@ impl<T, F, A: Allocator> DrainFilter<'_, T, F, A>
58
58
59
59
#[ unstable( feature = "drain_filter" , reason = "recently added" , issue = "43244" ) ]
60
60
impl < T , F , A : Allocator > Iterator for DrainFilter < ' _ , T , F , A >
61
- where
62
- F : FnMut ( & mut T ) -> bool ,
61
+ where
62
+ F : FnMut ( & mut T ) -> bool ,
63
63
{
64
64
type Item = T ;
65
65
@@ -96,20 +96,20 @@ impl<T, F, A: Allocator> Iterator for DrainFilter<'_, T, F, A>
96
96
97
97
#[ unstable( feature = "drain_filter" , reason = "recently added" , issue = "43244" ) ]
98
98
impl < T , F , A : Allocator > Drop for DrainFilter < ' _ , T , F , A >
99
- where
100
- F : FnMut ( & mut T ) -> bool ,
99
+ where
100
+ F : FnMut ( & mut T ) -> bool ,
101
101
{
102
102
fn drop ( & mut self ) {
103
103
struct BackshiftOnDrop < ' a , ' b , T , F , A : Allocator >
104
- where
105
- F : FnMut ( & mut T ) -> bool ,
104
+ where
105
+ F : FnMut ( & mut T ) -> bool ,
106
106
{
107
107
drain : & ' b mut DrainFilter < ' a , T , F , A > ,
108
108
}
109
109
110
110
impl < ' a , ' b , T , F , A : Allocator > Drop for BackshiftOnDrop < ' a , ' b , T , F , A >
111
- where
112
- F : FnMut ( & mut T ) -> bool ,
111
+ where
112
+ F : FnMut ( & mut T ) -> bool ,
113
113
{
114
114
fn drop ( & mut self ) {
115
115
unsafe {
@@ -140,4 +140,4 @@ impl<T, F, A: Allocator> Drop for DrainFilter<'_, T, F, A>
140
140
backshift. drain . for_each ( drop) ;
141
141
}
142
142
}
143
- }
143
+ }
0 commit comments