Skip to content

Commit ebeeab4

Browse files
committed
---
yaml --- r: 56255 b: refs/heads/auto c: d7a2ae6 h: refs/heads/master i: 56253: 6378de5 56251: 311a743 56247: 4d63fb9 56239: aefb955 56223: 9c49d35 56191: e31a9c2 v: v3
1 parent 178e716 commit ebeeab4

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1414
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1515
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1616
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
17-
refs/heads/auto: ae1c9ebf3c3a0a7e176314f742f533a788ea0dd2
17+
refs/heads/auto: d7a2ae6c42f1d9755178485fd93f234c2df8a8fe
1818
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1919
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c

branches/auto/src/libcore/iterator.rs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ pub trait IteratorUtil<A> {
2222
// FIXME: #5898: should be called map
2323
fn transform<'r, B>(self, f: &'r fn(A) -> B) -> MapIterator<'r, A, B, Self>;
2424
fn filter<'r>(self, predicate: &'r fn(&A) -> bool) -> FilterIterator<'r, A, Self>;
25+
fn enumerate(self) -> EnumerateIterator<Self>;
2526
fn skip_while<'r>(self, predicate: &'r fn(&A) -> bool) -> SkipWhileIterator<'r, A, Self>;
2627
fn take_while<'r>(self, predicate: &'r fn(&A) -> bool) -> TakeWhileIterator<'r, A, Self>;
2728
fn skip(self, n: uint) -> SkipIterator<Self>;
2829
fn take(self, n: uint) -> TakeIterator<Self>;
29-
fn enumerate(self) -> EnumerateIterator<Self>;
3030
fn advance(&mut self, f: &fn(A) -> bool);
3131
}
3232

@@ -101,6 +101,21 @@ impl<A, B, T: Iterator<A>, U: Iterator<B>> Iterator<(A, B)> for ZipIterator<T, U
101101
}
102102
}
103103

104+
pub struct MapIterator<'self, A, B, T> {
105+
priv iter: T,
106+
priv f: &'self fn(A) -> B
107+
}
108+
109+
impl<'self, A, B, T: Iterator<A>> Iterator<B> for MapIterator<'self, A, B, T> {
110+
#[inline]
111+
fn next(&mut self) -> Option<B> {
112+
match self.iter.next() {
113+
Some(a) => Some((self.f)(a)),
114+
_ => None
115+
}
116+
}
117+
}
118+
104119
pub struct FilterIterator<'self, A, T> {
105120
priv iter: T,
106121
priv predicate: &'self fn(&A) -> bool
@@ -120,21 +135,6 @@ impl<'self, A, T: Iterator<A>> Iterator<A> for FilterIterator<'self, A, T> {
120135
}
121136
}
122137

123-
pub struct MapIterator<'self, A, B, T> {
124-
priv iter: T,
125-
priv f: &'self fn(A) -> B
126-
}
127-
128-
impl<'self, A, B, T: Iterator<A>> Iterator<B> for MapIterator<'self, A, B, T> {
129-
#[inline]
130-
fn next(&mut self) -> Option<B> {
131-
match self.iter.next() {
132-
Some(a) => Some((self.f)(a)),
133-
_ => None
134-
}
135-
}
136-
}
137-
138138
pub struct EnumerateIterator<T> {
139139
priv iter: T,
140140
priv count: uint

0 commit comments

Comments
 (0)