Skip to content

Commit f09e289

Browse files
author
Jorge Aparicio
committed
---
yaml --- r: 163262 b: refs/heads/snap-stage3 c: 7e3493e h: refs/heads/master v: v3
1 parent f3931f7 commit f09e289

File tree

2 files changed

+19
-12
lines changed

2 files changed

+19
-12
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: a051ba1dffa2648a9cd25d39f70fbb5089505762
4+
refs/heads/snap-stage3: 7e3493e5e3a0cc7b4c99f36865305b241ff993d0
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: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ pub trait IteratorExt<A>: Iterator<A> {
432432
/// ```
433433
#[inline]
434434
#[unstable = "waiting for unboxed closures"]
435-
fn inspect<'r>(self, f: |&A|: 'r) -> Inspect<'r, A, Self> {
435+
fn inspect<F>(self, f: F) -> Inspect<A, Self, F> where F: FnMut(&A) {
436436
Inspect{iter: self, f: f}
437437
}
438438

@@ -777,7 +777,10 @@ pub trait ExactSizeIterator<A> : DoubleEndedIterator<A> {
777777
#[unstable = "trait is unstable"]
778778
impl<A, T: ExactSizeIterator<A>> ExactSizeIterator<(uint, A)> for Enumerate<T> {}
779779
#[unstable = "trait is unstable"]
780-
impl<'a, A, T: ExactSizeIterator<A>> ExactSizeIterator<A> for Inspect<'a, A, T> {}
780+
impl<A, I, F> ExactSizeIterator<A> for Inspect<A, I, F> where
781+
I: ExactSizeIterator<A>,
782+
F: FnMut(&A),
783+
{}
781784
#[unstable = "trait is unstable"]
782785
impl<A, T: ExactSizeIterator<A>> ExactSizeIterator<A> for Rev<T> {}
783786
#[unstable = "trait is unstable"]
@@ -2012,12 +2015,12 @@ impl<T> Fuse<T> {
20122015
/// element before yielding it.
20132016
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
20142017
#[unstable = "waiting for unboxed closures"]
2015-
pub struct Inspect<'a, A, T> {
2016-
iter: T,
2017-
f: |&A|: 'a
2018+
pub struct Inspect<A, I, F> where I: Iterator<A>, F: FnMut(&A) {
2019+
iter: I,
2020+
f: F,
20182021
}
20192022

2020-
impl<'a, A, T> Inspect<'a, A, T> {
2023+
impl<A, I, F> Inspect<A, I, F> where I: Iterator<A>, F: FnMut(&A) {
20212024
#[inline]
20222025
fn do_inspect(&mut self, elt: Option<A>) -> Option<A> {
20232026
match elt {
@@ -2030,7 +2033,7 @@ impl<'a, A, T> Inspect<'a, A, T> {
20302033
}
20312034

20322035
#[unstable = "trait is unstable"]
2033-
impl<'a, A, T: Iterator<A>> Iterator<A> for Inspect<'a, A, T> {
2036+
impl<A, I, F> Iterator<A> for Inspect<A, I, F> where I: Iterator<A>, F: FnMut(&A) {
20342037
#[inline]
20352038
fn next(&mut self) -> Option<A> {
20362039
let next = self.iter.next();
@@ -2044,8 +2047,10 @@ impl<'a, A, T: Iterator<A>> Iterator<A> for Inspect<'a, A, T> {
20442047
}
20452048

20462049
#[unstable = "trait is unstable"]
2047-
impl<'a, A, T: DoubleEndedIterator<A>> DoubleEndedIterator<A>
2048-
for Inspect<'a, A, T> {
2050+
impl<A, I, F> DoubleEndedIterator<A> for Inspect<A, I, F> where
2051+
I: DoubleEndedIterator<A>,
2052+
F: FnMut(&A),
2053+
{
20492054
#[inline]
20502055
fn next_back(&mut self) -> Option<A> {
20512056
let next = self.iter.next_back();
@@ -2054,8 +2059,10 @@ for Inspect<'a, A, T> {
20542059
}
20552060

20562061
#[experimental = "trait is experimental"]
2057-
impl<'a, A, T: RandomAccessIterator<A>> RandomAccessIterator<A>
2058-
for Inspect<'a, A, T> {
2062+
impl<A, I, F> RandomAccessIterator<A> for Inspect<A, I, F> where
2063+
I: RandomAccessIterator<A>,
2064+
F: FnMut(&A),
2065+
{
20592066
#[inline]
20602067
fn indexable(&self) -> uint {
20612068
self.iter.indexable()

0 commit comments

Comments
 (0)