File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
src/libcore/iter/adapters Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,15 @@ pub struct Zip<A, B> {
1818 index : usize ,
1919 len : usize ,
2020}
21+ impl < A : Iterator , B : Iterator > Zip < A , B > {
22+ fn super_nth ( & mut self , mut n : usize ) -> Option < ( A :: Item , B :: Item ) > {
23+ while let Some ( x) = Iterator :: next ( self ) {
24+ if n == 0 { return Some ( x) }
25+ n -= 1 ;
26+ }
27+ None
28+ }
29+ }
2130
2231#[ stable( feature = "rust1" , since = "1.0.0" ) ]
2332impl < A , B > Iterator for Zip < A , B > where A : Iterator , B : Iterator
@@ -59,13 +68,6 @@ pub(in super::super) trait ZipImpl<A, B> {
5968 fn next ( & mut self ) -> Option < Self :: Item > ;
6069 fn size_hint ( & self ) -> ( usize , Option < usize > ) ;
6170 fn nth ( & mut self , n : usize ) -> Option < Self :: Item > ;
62- fn super_nth ( & mut self , mut n : usize ) -> Option < Self :: Item > {
63- while let Some ( x) = self . next ( ) {
64- if n == 0 { return Some ( x) }
65- n -= 1 ;
66- }
67- None
68- }
6971 fn next_back ( & mut self ) -> Option < Self :: Item >
7072 where A : DoubleEndedIterator + ExactSizeIterator ,
7173 B : DoubleEndedIterator + ExactSizeIterator ;
You can’t perform that action at this time.
0 commit comments