@@ -105,7 +105,9 @@ pub struct GraphemeIndices<'a> {
105
105
iter : Graphemes < ' a > ,
106
106
}
107
107
108
- impl < ' a > Iterator < ( uint , & ' a str ) > for GraphemeIndices < ' a > {
108
+ impl < ' a > Iterator for GraphemeIndices < ' a > {
109
+ type Item = ( uint , & ' a str ) ;
110
+
109
111
#[ inline]
110
112
fn next ( & mut self ) -> Option < ( uint , & ' a str ) > {
111
113
self . iter . next ( ) . map ( |s| ( s. as_ptr ( ) as uint - self . start_offset , s) )
@@ -117,7 +119,7 @@ impl<'a> Iterator<(uint, &'a str)> for GraphemeIndices<'a> {
117
119
}
118
120
}
119
121
120
- impl < ' a > DoubleEndedIterator < ( uint , & ' a str ) > for GraphemeIndices < ' a > {
122
+ impl < ' a > DoubleEndedIterator for GraphemeIndices < ' a > {
121
123
#[ inline]
122
124
fn next_back ( & mut self ) -> Option < ( uint , & ' a str ) > {
123
125
self . iter . next_back ( ) . map ( |s| ( s. as_ptr ( ) as uint - self . start_offset , s) )
@@ -145,7 +147,9 @@ enum GraphemeState {
145
147
Regional ,
146
148
}
147
149
148
- impl < ' a > Iterator < & ' a str > for Graphemes < ' a > {
150
+ impl < ' a > Iterator for Graphemes < ' a > {
151
+ type Item = & ' a str ;
152
+
149
153
#[ inline]
150
154
fn size_hint ( & self ) -> ( uint , Option < uint > ) {
151
155
let slen = self . string . len ( ) ;
@@ -251,7 +255,7 @@ impl<'a> Iterator<&'a str> for Graphemes<'a> {
251
255
}
252
256
}
253
257
254
- impl < ' a > DoubleEndedIterator < & ' a str > for Graphemes < ' a > {
258
+ impl < ' a > DoubleEndedIterator for Graphemes < ' a > {
255
259
#[ inline]
256
260
fn next_back ( & mut self ) -> Option < & ' a str > {
257
261
use tables:: grapheme as gr;
@@ -428,7 +432,9 @@ impl Utf16Item {
428
432
}
429
433
}
430
434
431
- impl < ' a > Iterator < Utf16Item > for Utf16Items < ' a > {
435
+ impl < ' a > Iterator for Utf16Items < ' a > {
436
+ type Item = Utf16Item ;
437
+
432
438
fn next ( & mut self ) -> Option < Utf16Item > {
433
439
let u = match self . iter . next ( ) {
434
440
Some ( u) => * u,
@@ -505,12 +511,14 @@ pub struct Utf16Encoder<I> {
505
511
506
512
impl < I > Utf16Encoder < I > {
507
513
/// Create an UTF-16 encoder from any `char` iterator.
508
- pub fn new ( chars : I ) -> Utf16Encoder < I > where I : Iterator < char > {
514
+ pub fn new ( chars : I ) -> Utf16Encoder < I > where I : Iterator < Item = char > {
509
515
Utf16Encoder { chars : chars, extra : 0 }
510
516
}
511
517
}
512
518
513
- impl < I > Iterator < u16 > for Utf16Encoder < I > where I : Iterator < char > {
519
+ impl < I > Iterator for Utf16Encoder < I > where I : Iterator < Item =char > {
520
+ type Item = u16 ;
521
+
514
522
#[ inline]
515
523
fn next ( & mut self ) -> Option < u16 > {
516
524
if self . extra != 0 {
@@ -537,9 +545,11 @@ impl<I> Iterator<u16> for Utf16Encoder<I> where I: Iterator<char> {
537
545
}
538
546
}
539
547
540
- impl < ' a > Iterator < & ' a str > for Words < ' a > {
548
+ impl < ' a > Iterator for Words < ' a > {
549
+ type Item = & ' a str ;
550
+
541
551
fn next ( & mut self ) -> Option < & ' a str > { self . inner . next ( ) }
542
552
}
543
- impl < ' a > DoubleEndedIterator < & ' a str > for Words < ' a > {
553
+ impl < ' a > DoubleEndedIterator for Words < ' a > {
544
554
fn next_back ( & mut self ) -> Option < & ' a str > { self . inner . next_back ( ) }
545
555
}
0 commit comments