Skip to content

Commit 180b37b

Browse files
author
Jorge Aparicio
committed
---
yaml --- r: 163254 b: refs/heads/snap-stage3 c: eede5d2 h: refs/heads/master v: v3
1 parent f2a3816 commit 180b37b

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 9146a919b616e39e528e4d7100d16eef52f1f852
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 80a04b1aed74a6f6dc23c3bca6b869b28825f3c6
4+
refs/heads/snap-stage3: eede5d2bce06cd0546864b279389ec48e8ad7917
55
refs/heads/try: 20cbbffeefc1f35e2ea63afce7b42fbd79611d42
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d

branches/snap-stage3/src/libcore/iter.rs

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ pub trait IteratorExt<A>: Iterator<A> {
201201
/// ```
202202
#[inline]
203203
#[unstable = "waiting for unboxed closures"]
204-
fn filter_map<'r, B>(self, f: |A|: 'r -> Option<B>) -> FilterMap<'r, A, B, Self> {
204+
fn filter_map<B, F>(self, f: F) -> FilterMap<A, B, Self, F> where F: FnMut(A) -> Option<B> {
205205
FilterMap { iter: self, f: f }
206206
}
207207

@@ -1483,13 +1483,16 @@ impl<A, I, P> DoubleEndedIterator<A> for Filter<A, I, P> where
14831483
/// An iterator which uses `f` to both filter and map elements from `iter`
14841484
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
14851485
#[stable]
1486-
pub struct FilterMap<'a, A, B, T> {
1487-
iter: T,
1488-
f: |A|: 'a -> Option<B>
1486+
pub struct FilterMap<A, B, I, F> where I: Iterator<A>, F: FnMut(A) -> Option<B> {
1487+
iter: I,
1488+
f: F,
14891489
}
14901490

14911491
#[unstable = "trait is unstable"]
1492-
impl<'a, A, B, T: Iterator<A>> Iterator<B> for FilterMap<'a, A, B, T> {
1492+
impl<A, B, I, F> Iterator<B> for FilterMap<A, B, I, F> where
1493+
I: Iterator<A>,
1494+
F: FnMut(A) -> Option<B>,
1495+
{
14931496
#[inline]
14941497
fn next(&mut self) -> Option<B> {
14951498
for x in self.iter {
@@ -1509,8 +1512,10 @@ impl<'a, A, B, T: Iterator<A>> Iterator<B> for FilterMap<'a, A, B, T> {
15091512
}
15101513

15111514
#[unstable = "trait is unstable"]
1512-
impl<'a, A, B, T: DoubleEndedIterator<A>> DoubleEndedIterator<B>
1513-
for FilterMap<'a, A, B, T> {
1515+
impl<A, B, I, F> DoubleEndedIterator<B> for FilterMap<A, B, I, F> where
1516+
I: DoubleEndedIterator<A>,
1517+
F: FnMut(A) -> Option<B>,
1518+
{
15141519
#[inline]
15151520
fn next_back(&mut self) -> Option<B> {
15161521
for x in self.iter.by_ref().rev() {

0 commit comments

Comments
 (0)