@@ -48,15 +48,15 @@ struct Node<T> {
48
48
49
49
/// Double-ended DList iterator
50
50
#[ deriving( Clone ) ]
51
- pub struct DListIterator < ' self , T > {
52
- priv head : & ' self Link < T > ,
51
+ pub struct DListIterator < ' a , T > {
52
+ priv head : & ' a Link < T > ,
53
53
priv tail : Rawlink < Node < T > > ,
54
54
priv nelem : uint ,
55
55
}
56
56
57
57
/// Double-ended mutable DList iterator
58
- pub struct MutDListIterator < ' self , T > {
59
- priv list : & ' self mut DList < T > ,
58
+ pub struct MutDListIterator < ' a , T > {
59
+ priv list : & ' a mut DList < T > ,
60
60
priv head : Rawlink < Node < T > > ,
61
61
priv tail : Rawlink < Node < T > > ,
62
62
priv nelem : uint ,
@@ -439,9 +439,9 @@ impl<T> Drop for DList<T> {
439
439
}
440
440
441
441
442
- impl < ' self , A > Iterator < & ' self A > for DListIterator < ' self , A > {
442
+ impl < ' a , A > Iterator < & ' a A > for DListIterator < ' a , A > {
443
443
#[ inline]
444
- fn next ( & mut self ) -> Option < & ' self A > {
444
+ fn next ( & mut self ) -> Option < & ' a A > {
445
445
if self . nelem == 0 {
446
446
return None ;
447
447
}
@@ -458,9 +458,9 @@ impl<'self, A> Iterator<&'self A> for DListIterator<'self, A> {
458
458
}
459
459
}
460
460
461
- impl < ' self , A > DoubleEndedIterator < & ' self A > for DListIterator < ' self , A > {
461
+ impl < ' a , A > DoubleEndedIterator < & ' a A > for DListIterator < ' a , A > {
462
462
#[ inline]
463
- fn next_back ( & mut self ) -> Option < & ' self A > {
463
+ fn next_back ( & mut self ) -> Option < & ' a A > {
464
464
if self . nelem == 0 {
465
465
return None ;
466
466
}
@@ -473,11 +473,11 @@ impl<'self, A> DoubleEndedIterator<&'self A> for DListIterator<'self, A> {
473
473
}
474
474
}
475
475
476
- impl < ' self , A > ExactSize < & ' self A > for DListIterator < ' self , A > { }
476
+ impl < ' a , A > ExactSize < & ' a A > for DListIterator < ' a , A > { }
477
477
478
- impl < ' self , A > Iterator < & ' self mut A > for MutDListIterator < ' self , A > {
478
+ impl < ' a , A > Iterator < & ' a mut A > for MutDListIterator < ' a , A > {
479
479
#[ inline]
480
- fn next ( & mut self ) -> Option < & ' self mut A > {
480
+ fn next ( & mut self ) -> Option < & ' a mut A > {
481
481
if self . nelem == 0 {
482
482
return None ;
483
483
}
@@ -497,9 +497,9 @@ impl<'self, A> Iterator<&'self mut A> for MutDListIterator<'self, A> {
497
497
}
498
498
}
499
499
500
- impl < ' self , A > DoubleEndedIterator < & ' self mut A > for MutDListIterator < ' self , A > {
500
+ impl < ' a , A > DoubleEndedIterator < & ' a mut A > for MutDListIterator < ' a , A > {
501
501
#[ inline]
502
- fn next_back ( & mut self ) -> Option < & ' self mut A > {
502
+ fn next_back ( & mut self ) -> Option < & ' a mut A > {
503
503
if self . nelem == 0 {
504
504
return None ;
505
505
}
@@ -511,7 +511,7 @@ impl<'self, A> DoubleEndedIterator<&'self mut A> for MutDListIterator<'self, A>
511
511
}
512
512
}
513
513
514
- impl < ' self , A > ExactSize < & ' self mut A > for MutDListIterator < ' self , A > { }
514
+ impl < ' a , A > ExactSize < & ' a mut A > for MutDListIterator < ' a , A > { }
515
515
516
516
/// Allow mutating the DList while iterating
517
517
pub trait ListInsertion < A > {
@@ -525,7 +525,7 @@ pub trait ListInsertion<A> {
525
525
}
526
526
527
527
// private methods for MutDListIterator
528
- impl < ' self , A > MutDListIterator < ' self , A > {
528
+ impl < ' a , A > MutDListIterator < ' a , A > {
529
529
fn insert_next_node ( & mut self , mut ins_node : ~Node < A > ) {
530
530
// Insert before `self.head` so that it is between the
531
531
// previously yielded element and self.head.
@@ -547,7 +547,7 @@ impl<'self, A> MutDListIterator<'self, A> {
547
547
}
548
548
}
549
549
550
- impl < ' self , A > ListInsertion < A > for MutDListIterator < ' self , A > {
550
+ impl < ' a , A > ListInsertion < A > for MutDListIterator < ' a , A > {
551
551
#[ inline]
552
552
fn insert_next ( & mut self , elt : A ) {
553
553
self . insert_next_node ( ~Node :: new ( elt) )
0 commit comments