NamesIterDynamic(::std::slice::Iter<'a, Option<String>>)
}
-impl<'a> Iterator<Option<String>> for NamesIter<'a> {
+impl<'a> Iterator for NamesIter<'a> {
+ type Item = Option<String>;
+
fn next(&mut self) -> Option<Option<String>> {
match *self {
NamesIterNative(ref mut i) => i.next().map(|x| x.map(|s| s.to_string())),
last: uint,
}
-impl<'r, 't> Iterator<&'t str> for RegexSplits<'r, 't> {
+impl<'r, 't> Iterator for RegexSplits<'r, 't> {
+ type Item = &'t str;
+
fn next(&mut self) -> Option<&'t str> {
let text = self.finder.search;
match self.finder.next() {
limit: uint,
}
-impl<'r, 't> Iterator<&'t str> for RegexSplitsN<'r, 't> {
+impl<'r, 't> Iterator for RegexSplitsN<'r, 't> {
+ type Item = &'t str;
+
fn next(&mut self) -> Option<&'t str> {
let text = self.splits.finder.search;
if self.cur >= self.limit {
caps: &'t Captures<'t>,
}
-impl<'t> Iterator<&'t str> for SubCaptures<'t> {
+impl<'t> Iterator for SubCaptures<'t> {
+ type Item = &'t str;
+
fn next(&mut self) -> Option<&'t str> {
if self.idx < self.caps.len() {
self.idx += 1;
caps: &'t Captures<'t>,
}
-impl<'t> Iterator<Option<(uint, uint)>> for SubCapturesPos<'t> {
+impl<'t> Iterator for SubCapturesPos<'t> {
+ type Item = Option<(uint, uint)>;
+
fn next(&mut self) -> Option<Option<(uint, uint)>> {
if self.idx < self.caps.len() {
self.idx += 1;
last_end: uint,
}
-impl<'r, 't> Iterator<Captures<'t>> for FindCaptures<'r, 't> {
+impl<'r, 't> Iterator for FindCaptures<'r, 't> {
+ type Item = Captures<'t>;
+
fn next(&mut self) -> Option<Captures<'t>> {
if self.last_end > self.search.len() {
return None
last_end: uint,
}
-impl<'r, 't> Iterator<(uint, uint)> for FindMatches<'r, 't> {
+impl<'r, 't> Iterator for FindMatches<'r, 't> {
+ type Item = (uint, uint);
+
fn next(&mut self) -> Option<(uint, uint)> {
if self.last_end > self.search.len() {
return None