Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions regex_macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
html_root_url = "http://doc.rust-lang.org/nightly/")]

#![feature(plugin_registrar, quote)]
#![feature(associated_types, plugin_registrar, quote)]

extern crate regex;
extern crate syntax;
Expand Down Expand Up @@ -601,7 +601,7 @@ fn exec<'t>(which: ::regex::native::MatchKind, input: &'t str,

// Converts `xs` to a `[x1, x2, .., xN]` expression by calling `to_expr`
// on each element in `xs`.
fn vec_expr<T, It: Iterator<T>>(&self, xs: It,
fn vec_expr<T, It: Iterator<Item=T>>(&self, xs: It,
to_expr: |&ExtCtxt, T| -> P<ast::Expr>)
-> P<ast::Expr> {
let exprs = xs.map(|x| to_expr(self.cx, x)).collect();
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@
//! characters in the search text and `m` is the number of instructions in a
//! compiled expression.

#![feature(macro_rules, slicing_syntax, globs)]
#![feature(associated_types, macro_rules, slicing_syntax, globs)]
#![deny(missing_docs)]
#![cfg_attr(test, deny(warnings))]
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
Expand Down
28 changes: 21 additions & 7 deletions src/re.rs
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,9 @@ pub enum NamesIter<'a> {
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())),
Expand Down Expand Up @@ -603,7 +605,9 @@ pub struct RegexSplits<'r, 't> {
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() {
Expand Down Expand Up @@ -637,7 +641,9 @@ pub struct RegexSplitsN<'r, 't> {
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 {
Expand Down Expand Up @@ -799,7 +805,9 @@ pub struct SubCaptures<'t> {
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;
Expand All @@ -821,7 +829,9 @@ pub struct SubCapturesPos<'t> {
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;
Expand All @@ -846,7 +856,9 @@ pub struct FindCaptures<'r, 't> {
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
Expand Down Expand Up @@ -888,7 +900,9 @@ pub struct FindMatches<'r, 't> {
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
Expand Down