Skip to content

Commit a332616

Browse files
author
Jorge Aparicio
committed
---
yaml --- r: 163735 b: refs/heads/master c: 801ae13 h: refs/heads/master i: 163733: 26ae82d 163731: 28ba0e5 163727: 3ae1037 v: v3
1 parent a76edb0 commit a332616

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
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: 44b419b82084e1dc1abd8f8cb4b603fe1c43483c
2+
refs/heads/master: 801ae1333c05ab641ff08c14fee776c08f42cff8
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 8443b09e361b96d1f9b7f45a65ed0d31c0e86e70
55
refs/heads/try: 20cbbffeefc1f35e2ea63afce7b42fbd79611d42

trunk/src/libcore/iter.rs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ pub trait IteratorExt<A>: Iterator<A> {
183183
/// ```
184184
#[inline]
185185
#[unstable = "waiting for unboxed closures"]
186-
fn filter<'r>(self, predicate: |&A|: 'r -> bool) -> Filter<'r, A, Self> {
186+
fn filter<P>(self, predicate: P) -> Filter<A, Self, P> where P: FnMut(&A) -> bool {
187187
Filter{iter: self, predicate: predicate}
188188
}
189189

@@ -1438,13 +1438,13 @@ impl<A, B, I, F> RandomAccessIterator<B> for Map<A, B, I, F> where
14381438
/// An iterator which filters the elements of `iter` with `predicate`
14391439
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
14401440
#[stable]
1441-
pub struct Filter<'a, A, T> {
1442-
iter: T,
1443-
predicate: |&A|: 'a -> bool
1441+
pub struct Filter<A, I, P> where I: Iterator<A>, P: FnMut(&A) -> bool {
1442+
iter: I,
1443+
predicate: P,
14441444
}
14451445

14461446
#[unstable = "trait is unstable"]
1447-
impl<'a, A, T: Iterator<A>> Iterator<A> for Filter<'a, A, T> {
1447+
impl<A, I, P> Iterator<A> for Filter<A, I, P> where I: Iterator<A>, P: FnMut(&A) -> bool {
14481448
#[inline]
14491449
fn next(&mut self) -> Option<A> {
14501450
for x in self.iter {
@@ -1465,7 +1465,10 @@ impl<'a, A, T: Iterator<A>> Iterator<A> for Filter<'a, A, T> {
14651465
}
14661466

14671467
#[unstable = "trait is unstable"]
1468-
impl<'a, A, T: DoubleEndedIterator<A>> DoubleEndedIterator<A> for Filter<'a, A, T> {
1468+
impl<A, I, P> DoubleEndedIterator<A> for Filter<A, I, P> where
1469+
I: DoubleEndedIterator<A>,
1470+
P: FnMut(&A) -> bool,
1471+
{
14691472
#[inline]
14701473
fn next_back(&mut self) -> Option<A> {
14711474
for x in self.iter.by_ref().rev() {

0 commit comments

Comments
 (0)