Skip to content

Commit 65b85ed

Browse files
author
Jorge Aparicio
committed
---
yaml --- r: 167866 b: refs/heads/master c: f3333d5 h: refs/heads/master v: v3
1 parent c73930e commit 65b85ed

File tree

3 files changed

+23
-8
lines changed

3 files changed

+23
-8
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 17cf5e8104691cc6c15e4ea2e284c52a7b6760da
2+
refs/heads/master: f3333d5e1058e6e36c3754ae29ce6c708b35f082
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: c89417130f042c58adc60012e7cddc4ef70b70b9
55
refs/heads/try: 5204084bd2e46af7cc6e0147430e44dd0d657bbb

trunk/src/libregex/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,7 @@
373373
#![allow(unknown_features)]
374374
#![feature(macro_rules, phase, slicing_syntax, globs)]
375375
#![feature(unboxed_closures)]
376+
#![feature(associated_types)]
376377
#![deny(missing_docs)]
377378

378379
#[cfg(test)]

trunk/src/libregex/re.rs

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,9 @@ pub enum NamesIter<'a> {
546546
NamesIterDynamic(::std::slice::Iter<'a, Option<String>>)
547547
}
548548

549-
impl<'a> Iterator<Option<String>> for NamesIter<'a> {
549+
impl<'a> Iterator for NamesIter<'a> {
550+
type Item = Option<String>;
551+
550552
fn next(&mut self) -> Option<Option<String>> {
551553
match *self {
552554
NamesIterNative(ref mut i) => i.next().map(|x| x.map(|s| s.to_string())),
@@ -603,7 +605,9 @@ pub struct RegexSplits<'r, 't> {
603605
last: uint,
604606
}
605607

606-
impl<'r, 't> Iterator<&'t str> for RegexSplits<'r, 't> {
608+
impl<'r, 't> Iterator for RegexSplits<'r, 't> {
609+
type Item = &'t str;
610+
607611
fn next(&mut self) -> Option<&'t str> {
608612
let text = self.finder.search;
609613
match self.finder.next() {
@@ -638,7 +642,9 @@ pub struct RegexSplitsN<'r, 't> {
638642
limit: uint,
639643
}
640644

641-
impl<'r, 't> Iterator<&'t str> for RegexSplitsN<'r, 't> {
645+
impl<'r, 't> Iterator for RegexSplitsN<'r, 't> {
646+
type Item = &'t str;
647+
642648
fn next(&mut self) -> Option<&'t str> {
643649
let text = self.splits.finder.search;
644650
if self.cur >= self.limit {
@@ -801,7 +807,9 @@ pub struct SubCaptures<'t> {
801807
caps: &'t Captures<'t>,
802808
}
803809

804-
impl<'t> Iterator<&'t str> for SubCaptures<'t> {
810+
impl<'t> Iterator for SubCaptures<'t> {
811+
type Item = &'t str;
812+
805813
fn next(&mut self) -> Option<&'t str> {
806814
if self.idx < self.caps.len() {
807815
self.idx += 1;
@@ -824,7 +832,9 @@ pub struct SubCapturesPos<'t> {
824832
caps: &'t Captures<'t>,
825833
}
826834

827-
impl<'t> Iterator<Option<(uint, uint)>> for SubCapturesPos<'t> {
835+
impl<'t> Iterator for SubCapturesPos<'t> {
836+
type Item = Option<(uint, uint)>;
837+
828838
fn next(&mut self) -> Option<Option<(uint, uint)>> {
829839
if self.idx < self.caps.len() {
830840
self.idx += 1;
@@ -850,7 +860,9 @@ pub struct FindCaptures<'r, 't> {
850860
last_end: uint,
851861
}
852862

853-
impl<'r, 't> Iterator<Captures<'t>> for FindCaptures<'r, 't> {
863+
impl<'r, 't> Iterator for FindCaptures<'r, 't> {
864+
type Item = Captures<'t>;
865+
854866
fn next(&mut self) -> Option<Captures<'t>> {
855867
if self.last_end > self.search.len() {
856868
return None
@@ -893,7 +905,9 @@ pub struct FindMatches<'r, 't> {
893905
last_end: uint,
894906
}
895907

896-
impl<'r, 't> Iterator<(uint, uint)> for FindMatches<'r, 't> {
908+
impl<'r, 't> Iterator for FindMatches<'r, 't> {
909+
type Item = (uint, uint);
910+
897911
fn next(&mut self) -> Option<(uint, uint)> {
898912
if self.last_end > self.search.len() {
899913
return None

0 commit comments

Comments
 (0)