Skip to content

Commit e24f618

Browse files
author
Jorge Aparicio
committed
---
yaml --- r: 163260 b: refs/heads/snap-stage3 c: ba480cb h: refs/heads/master v: v3
1 parent abb8aae commit e24f618

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
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: e2724cb1d53b368e6a18571f345f08a0dd2644c9
4+
refs/heads/snap-stage3: ba480cbf75387236a364961354b466cbee69146d
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: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -346,8 +346,9 @@ pub trait IteratorExt<A>: Iterator<A> {
346346
/// ```
347347
#[inline]
348348
#[unstable = "waiting for unboxed closures"]
349-
fn scan<'r, St, B>(self, initial_state: St, f: |&mut St, A|: 'r -> Option<B>)
350-
-> Scan<'r, A, B, Self, St> {
349+
fn scan<St, B, F>(self, initial_state: St, f: F) -> Scan<A, B, Self, St, F> where
350+
F: FnMut(&mut St, A) -> Option<B>,
351+
{
351352
Scan{iter: self, f: f, state: initial_state}
352353
}
353354

@@ -1833,16 +1834,19 @@ impl<A, T: RandomAccessIterator<A>> RandomAccessIterator<A> for Take<T> {
18331834
/// An iterator to maintain state while iterating another iterator
18341835
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
18351836
#[unstable = "waiting for unboxed closures"]
1836-
pub struct Scan<'a, A, B, T, St> {
1837-
iter: T,
1838-
f: |&mut St, A|: 'a -> Option<B>,
1837+
pub struct Scan<A, B, I, St, F> where I: Iterator<A>, F: FnMut(&mut St, A) -> Option<B> {
1838+
iter: I,
1839+
f: F,
18391840

18401841
/// The current internal state to be passed to the closure next.
18411842
pub state: St,
18421843
}
18431844

18441845
#[unstable = "trait is unstable"]
1845-
impl<'a, A, B, T: Iterator<A>, St> Iterator<B> for Scan<'a, A, B, T, St> {
1846+
impl<A, B, I, St, F> Iterator<B> for Scan<A, B, I, St, F> where
1847+
I: Iterator<A>,
1848+
F: FnMut(&mut St, A) -> Option<B>,
1849+
{
18461850
#[inline]
18471851
fn next(&mut self) -> Option<B> {
18481852
self.iter.next().and_then(|a| (self.f)(&mut self.state, a))

0 commit comments

Comments
 (0)