Skip to content

Commit 5e4f329

Browse files
author
Jorge Aparicio
committed
---
yaml --- r: 163743 b: refs/heads/master c: e2724cb h: refs/heads/master i: 163741: aca22d4 163739: 202215e 163735: a332616 163727: 3ae1037 163711: baedd05 v: v3
1 parent 803d4e3 commit 5e4f329

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
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: 0cfdc99c71f132f967cf968e5b2c9d20adf14b46
2+
refs/heads/master: e2724cb1d53b368e6a18571f345f08a0dd2644c9
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 8443b09e361b96d1f9b7f45a65ed0d31c0e86e70
55
refs/heads/try: 20cbbffeefc1f35e2ea63afce7b42fbd79611d42

trunk/src/libcore/iter.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ pub trait IteratorExt<A>: Iterator<A> {
283283
/// ```
284284
#[inline]
285285
#[unstable = "waiting for unboxed closures, may want to require peek"]
286-
fn take_while<'r>(self, predicate: |&A|: 'r -> bool) -> TakeWhile<'r, A, Self> {
286+
fn take_while<P>(self, predicate: P) -> TakeWhile<A, Self, P> where P: FnMut(&A) -> bool {
287287
TakeWhile{iter: self, flag: false, predicate: predicate}
288288
}
289289

@@ -1674,14 +1674,14 @@ impl<A, I, P> Iterator<A> for SkipWhile<A, I, P> where I: Iterator<A>, P: FnMut(
16741674
/// An iterator which only accepts elements while `predicate` is true
16751675
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
16761676
#[stable]
1677-
pub struct TakeWhile<'a, A, T> {
1678-
iter: T,
1677+
pub struct TakeWhile<A, I, P> where I: Iterator<A>, P: FnMut(&A) -> bool {
1678+
iter: I,
16791679
flag: bool,
1680-
predicate: |&A|: 'a -> bool
1680+
predicate: P,
16811681
}
16821682

16831683
#[unstable = "trait is unstable"]
1684-
impl<'a, A, T: Iterator<A>> Iterator<A> for TakeWhile<'a, A, T> {
1684+
impl<A, I, P> Iterator<A> for TakeWhile<A, I, P> where I: Iterator<A>, P: FnMut(&A) -> bool {
16851685
#[inline]
16861686
fn next(&mut self) -> Option<A> {
16871687
if self.flag {

0 commit comments

Comments
 (0)