@@ -51,21 +51,21 @@ struct Node<T> {
5151}
5252
5353/// An iterator over references to the items of a `DList`.
54- pub struct Items < ' a , T : ' a > {
54+ pub struct Iter < ' a , T : ' a > {
5555 head : & ' a Link < T > ,
5656 tail : Rawlink < Node < T > > ,
5757 nelem : uint ,
5858}
5959
6060// FIXME #11820: the &'a Option<> of the Link stops clone working.
61- impl < ' a , T > Clone for Items < ' a , T > {
62- fn clone ( & self ) -> Items < ' a , T > { * self }
61+ impl < ' a , T > Clone for Iter < ' a , T > {
62+ fn clone ( & self ) -> Iter < ' a , T > { * self }
6363}
6464
65- impl < ' a , T > Copy for Items < ' a , T > { }
65+ impl < ' a , T > Copy for Iter < ' a , T > { }
6666
6767/// An iterator over mutable references to the items of a `DList`.
68- pub struct MutItems < ' a , T : ' a > {
68+ pub struct IterMut < ' a , T : ' a > {
6969 list : & ' a mut DList < T > ,
7070 head : Rawlink < Node < T > > ,
7171 tail : Rawlink < Node < T > > ,
@@ -74,7 +74,7 @@ pub struct MutItems<'a, T:'a> {
7474
7575/// An iterator over mutable references to the items of a `DList`.
7676#[ deriving( Clone ) ]
77- pub struct MoveItems < T > {
77+ pub struct IntoIter < T > {
7878 list : DList < T >
7979}
8080
@@ -394,19 +394,19 @@ impl<T> DList<T> {
394394 /// Provides a forward iterator.
395395 #[ inline]
396396 #[ unstable = "matches collection reform specification, waiting for dust to settle" ]
397- pub fn iter < ' a > ( & ' a self ) -> Items < ' a , T > {
398- Items { nelem : self . len ( ) , head : & self . list_head , tail : self . list_tail }
397+ pub fn iter < ' a > ( & ' a self ) -> Iter < ' a , T > {
398+ Iter { nelem : self . len ( ) , head : & self . list_head , tail : self . list_tail }
399399 }
400400
401401 /// Provides a forward iterator with mutable references.
402402 #[ inline]
403403 #[ unstable = "matches collection reform specification, waiting for dust to settle" ]
404- pub fn iter_mut < ' a > ( & ' a mut self ) -> MutItems < ' a , T > {
404+ pub fn iter_mut < ' a > ( & ' a mut self ) -> IterMut < ' a , T > {
405405 let head_raw = match self . list_head {
406406 Some ( ref mut h) => Rawlink :: some ( & mut * * h) ,
407407 None => Rawlink :: none ( ) ,
408408 } ;
409- MutItems {
409+ IterMut {
410410 nelem : self . len ( ) ,
411411 head : head_raw,
412412 tail : self . list_tail ,
@@ -417,8 +417,8 @@ impl<T> DList<T> {
417417 /// Consumes the list into an iterator yielding elements by value.
418418 #[ inline]
419419 #[ unstable = "matches collection reform specification, waiting for dust to settle" ]
420- pub fn into_iter ( self ) -> MoveItems < T > {
421- MoveItems { list : self }
420+ pub fn into_iter ( self ) -> IntoIter < T > {
421+ IntoIter { list : self }
422422 }
423423
424424 /// Returns `true` if the `DList` is empty.
@@ -579,7 +579,7 @@ impl<T> Drop for DList<T> {
579579}
580580
581581
582- impl < ' a , A > Iterator < & ' a A > for Items < ' a , A > {
582+ impl < ' a , A > Iterator < & ' a A > for Iter < ' a , A > {
583583 #[ inline]
584584 fn next ( & mut self ) -> Option < & ' a A > {
585585 if self . nelem == 0 {
@@ -598,7 +598,7 @@ impl<'a, A> Iterator<&'a A> for Items<'a, A> {
598598 }
599599}
600600
601- impl < ' a , A > DoubleEndedIterator < & ' a A > for Items < ' a , A > {
601+ impl < ' a , A > DoubleEndedIterator < & ' a A > for Iter < ' a , A > {
602602 #[ inline]
603603 fn next_back ( & mut self ) -> Option < & ' a A > {
604604 if self . nelem == 0 {
@@ -612,9 +612,9 @@ impl<'a, A> DoubleEndedIterator<&'a A> for Items<'a, A> {
612612 }
613613}
614614
615- impl < ' a , A > ExactSizeIterator < & ' a A > for Items < ' a , A > { }
615+ impl < ' a , A > ExactSizeIterator < & ' a A > for Iter < ' a , A > { }
616616
617- impl < ' a , A > Iterator < & ' a mut A > for MutItems < ' a , A > {
617+ impl < ' a , A > Iterator < & ' a mut A > for IterMut < ' a , A > {
618618 #[ inline]
619619 fn next ( & mut self ) -> Option < & ' a mut A > {
620620 if self . nelem == 0 {
@@ -636,7 +636,7 @@ impl<'a, A> Iterator<&'a mut A> for MutItems<'a, A> {
636636 }
637637}
638638
639- impl < ' a , A > DoubleEndedIterator < & ' a mut A > for MutItems < ' a , A > {
639+ impl < ' a , A > DoubleEndedIterator < & ' a mut A > for IterMut < ' a , A > {
640640 #[ inline]
641641 fn next_back ( & mut self ) -> Option < & ' a mut A > {
642642 if self . nelem == 0 {
@@ -650,7 +650,7 @@ impl<'a, A> DoubleEndedIterator<&'a mut A> for MutItems<'a, A> {
650650 }
651651}
652652
653- impl < ' a , A > ExactSizeIterator < & ' a mut A > for MutItems < ' a , A > { }
653+ impl < ' a , A > ExactSizeIterator < & ' a mut A > for IterMut < ' a , A > { }
654654
655655/// Allows mutating a `DList` while iterating.
656656pub trait ListInsertion < A > {
@@ -664,8 +664,8 @@ pub trait ListInsertion<A> {
664664 fn peek_next < ' a > ( & ' a mut self ) -> Option < & ' a mut A > ;
665665}
666666
667- // private methods for MutItems
668- impl < ' a , A > MutItems < ' a , A > {
667+ // private methods for IterMut
668+ impl < ' a , A > IterMut < ' a , A > {
669669 fn insert_next_node ( & mut self , mut ins_node : Box < Node < A > > ) {
670670 // Insert before `self.head` so that it is between the
671671 // previously yielded element and self.head.
@@ -687,7 +687,7 @@ impl<'a, A> MutItems<'a, A> {
687687 }
688688}
689689
690- impl < ' a , A > ListInsertion < A > for MutItems < ' a , A > {
690+ impl < ' a , A > ListInsertion < A > for IterMut < ' a , A > {
691691 #[ inline]
692692 fn insert_next ( & mut self , elt : A ) {
693693 self . insert_next_node ( box Node :: new ( elt) )
@@ -702,7 +702,7 @@ impl<'a, A> ListInsertion<A> for MutItems<'a, A> {
702702 }
703703}
704704
705- impl < A > Iterator < A > for MoveItems < A > {
705+ impl < A > Iterator < A > for IntoIter < A > {
706706 #[ inline]
707707 fn next ( & mut self ) -> Option < A > { self . list . pop_front ( ) }
708708
@@ -712,7 +712,7 @@ impl<A> Iterator<A> for MoveItems<A> {
712712 }
713713}
714714
715- impl < A > DoubleEndedIterator < A > for MoveItems < A > {
715+ impl < A > DoubleEndedIterator < A > for IntoIter < A > {
716716 #[ inline]
717717 fn next_back ( & mut self ) -> Option < A > { self . list . pop_back ( ) }
718718}
0 commit comments