@@ -283,7 +283,7 @@ pub trait IteratorExt<A>: Iterator<A> {
283
283
/// ```
284
284
#[ inline]
285
285
#[ unstable = "waiting for unboxed closures, may want to require peek" ]
286
- fn take_while < ' r > ( self , predicate: | & A | : ' r -> bool ) -> TakeWhile <' r , A , Self > {
286
+ fn take_while < P > ( self , predicate : P ) -> TakeWhile < A , Self , P > where P : FnMut ( & A ) -> bool {
287
287
TakeWhile { iter : self , flag : false , predicate : predicate}
288
288
}
289
289
@@ -1674,14 +1674,14 @@ impl<A, I, P> Iterator<A> for SkipWhile<A, I, P> where I: Iterator<A>, P: FnMut(
1674
1674
/// An iterator which only accepts elements while `predicate` is true
1675
1675
#[ must_use = "iterator adaptors are lazy and do nothing unless consumed" ]
1676
1676
#[ stable]
1677
- pub struct TakeWhile < ' a , A , T > {
1678
- iter : T ,
1677
+ pub struct TakeWhile < A , I , P > where I : Iterator < A > , P : FnMut ( & A ) -> bool {
1678
+ iter : I ,
1679
1679
flag : bool ,
1680
- predicate: | & A | : ' a -> bool
1680
+ predicate : P ,
1681
1681
}
1682
1682
1683
1683
#[ unstable = "trait is unstable" ]
1684
- impl <' a , A , T : Iterator < A > > Iterator < A > for TakeWhile < ' a , A , T > {
1684
+ impl < A , I , P > Iterator < A > for TakeWhile < A , I , P > where I : Iterator < A > , P : FnMut ( & A ) -> bool {
1685
1685
#[ inline]
1686
1686
fn next ( & mut self ) -> Option < A > {
1687
1687
if self . flag {
0 commit comments