Skip to content

Commit f3931f7

Browse files
author
Jorge Aparicio
committed
---
yaml --- r: 163261 b: refs/heads/snap-stage3 c: a051ba1 h: refs/heads/master i: 163259: abb8aae v: v3
1 parent e24f618 commit f3931f7

File tree

2 files changed

+18
-11
lines changed

2 files changed

+18
-11
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: ba480cbf75387236a364961354b466cbee69146d
4+
refs/heads/snap-stage3: a051ba1dffa2648a9cd25d39f70fbb5089505762
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: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -372,8 +372,10 @@ pub trait IteratorExt<A>: Iterator<A> {
372372
/// ```
373373
#[inline]
374374
#[unstable = "waiting for unboxed closures"]
375-
fn flat_map<'r, B, U: Iterator<B>>(self, f: |A|: 'r -> U)
376-
-> FlatMap<'r, A, Self, U> {
375+
fn flat_map<B, U, F>(self, f: F) -> FlatMap<A, B, Self, U, F> where
376+
U: Iterator<B>,
377+
F: FnMut(A) -> U,
378+
{
377379
FlatMap{iter: self, f: f, frontiter: None, backiter: None }
378380
}
379381

@@ -1864,15 +1866,19 @@ impl<A, B, I, St, F> Iterator<B> for Scan<A, B, I, St, F> where
18641866
///
18651867
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
18661868
#[unstable = "waiting for unboxed closures"]
1867-
pub struct FlatMap<'a, A, T, U> {
1868-
iter: T,
1869-
f: |A|: 'a -> U,
1869+
pub struct FlatMap<A, B, I, U, F> where I: Iterator<A>, U: Iterator<B>, F: FnMut(A) -> U {
1870+
iter: I,
1871+
f: F,
18701872
frontiter: Option<U>,
18711873
backiter: Option<U>,
18721874
}
18731875

18741876
#[unstable = "trait is unstable"]
1875-
impl<'a, A, T: Iterator<A>, B, U: Iterator<B>> Iterator<B> for FlatMap<'a, A, T, U> {
1877+
impl<A, B, I, U, F> Iterator<B> for FlatMap<A, B, I, U, F> where
1878+
I: Iterator<A>,
1879+
U: Iterator<B>,
1880+
F: FnMut(A) -> U,
1881+
{
18761882
#[inline]
18771883
fn next(&mut self) -> Option<B> {
18781884
loop {
@@ -1901,10 +1907,11 @@ impl<'a, A, T: Iterator<A>, B, U: Iterator<B>> Iterator<B> for FlatMap<'a, A, T,
19011907
}
19021908

19031909
#[unstable = "trait is unstable"]
1904-
impl<'a,
1905-
A, T: DoubleEndedIterator<A>,
1906-
B, U: DoubleEndedIterator<B>> DoubleEndedIterator<B>
1907-
for FlatMap<'a, A, T, U> {
1910+
impl<A, B, I, U, F> DoubleEndedIterator<B> for FlatMap<A, B, I, U, F> where
1911+
I: DoubleEndedIterator<A>,
1912+
U: DoubleEndedIterator<B>,
1913+
F: FnMut(A) -> U,
1914+
{
19081915
#[inline]
19091916
fn next_back(&mut self) -> Option<B> {
19101917
loop {

0 commit comments

Comments
 (0)