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> {
18
18
index : usize ,
19
19
len : usize ,
20
20
}
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
+ }
21
30
22
31
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
23
32
impl < A , B > Iterator for Zip < A , B > where A : Iterator , B : Iterator
@@ -59,13 +68,6 @@ pub(in super::super) trait ZipImpl<A, B> {
59
68
fn next ( & mut self ) -> Option < Self :: Item > ;
60
69
fn size_hint ( & self ) -> ( usize , Option < usize > ) ;
61
70
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
- }
69
71
fn next_back ( & mut self ) -> Option < Self :: Item >
70
72
where A : DoubleEndedIterator + ExactSizeIterator ,
71
73
B : DoubleEndedIterator + ExactSizeIterator ;
You can’t perform that action at this time.
0 commit comments