Skip to content

Commit cac221a

Browse files
committed
---
yaml --- r: 63038 b: refs/heads/snap-stage3 c: c7b19b0 h: refs/heads/master v: v3
1 parent df16517 commit cac221a

File tree

3 files changed

+13
-15
lines changed

3 files changed

+13
-15
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: 2d28d645422c1617be58c8ca7ad9a457264ca850
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 32228f3d5781f93cc6f6419c1d6de33c5d1ba6c6
4+
refs/heads/snap-stage3: c7b19b04cbde053f0cf7a15b989bc6546cd2e265
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/doc/rust.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1297,7 +1297,7 @@ with matching types and type parameter counts.
12971297

12981298
An implementation can take type parameters,
12991299
which can be different from the type parameters taken by the trait it implements.
1300-
Implementation parameters are written after after the `impl` keyword.
1300+
Implementation parameters are written after the `impl` keyword.
13011301

13021302
~~~~
13031303
# trait Seq<T> { }

branches/snap-stage3/src/libstd/iterator.rs

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ pub trait IteratorUtil<A> {
186186
/// assert_eq!(it.next().get(), &5);
187187
/// assert!(it.next().is_none());
188188
/// ~~~
189-
fn skip(self, n: uint) -> SkipIterator<A, Self>;
189+
fn skip(self, n: uint) -> SkipIterator<Self>;
190190

191191
/// Creates an iterator which yields the first `n` elements of this
192192
/// iterator, and then it will always return None.
@@ -203,7 +203,7 @@ pub trait IteratorUtil<A> {
203203
/// assert_eq!(it.next().get(), &3);
204204
/// assert!(it.next().is_none());
205205
/// ~~~
206-
fn take(self, n: uint) -> TakeIterator<A, Self>;
206+
fn take(self, n: uint) -> TakeIterator<Self>;
207207

208208
/// Creates a new iterator which behaves in a similar fashion to foldl.
209209
/// There is a state which is passed between each iteration and can be
@@ -386,12 +386,12 @@ impl<A, T: Iterator<A>> IteratorUtil<A> for T {
386386
}
387387

388388
#[inline(always)]
389-
fn skip(self, n: uint) -> SkipIterator<A, T> {
389+
fn skip(self, n: uint) -> SkipIterator<T> {
390390
SkipIterator{iter: self, n: n}
391391
}
392392

393393
#[inline(always)]
394-
fn take(self, n: uint) -> TakeIterator<A, T> {
394+
fn take(self, n: uint) -> TakeIterator<T> {
395395
TakeIterator{iter: self, n: n}
396396
}
397397

@@ -739,14 +739,13 @@ impl<'self, A, T: Iterator<A>> Iterator<A> for TakeWhileIterator<'self, A, T> {
739739
}
740740
}
741741

742-
/// An iterator which skips over `n` elements of `iter`.
743-
// FIXME #6967: Dummy A parameter to get around type inference bug
744-
pub struct SkipIterator<A, T> {
742+
/// An iterator which skips over `n` elements of `iter`
743+
pub struct SkipIterator<T> {
745744
priv iter: T,
746745
priv n: uint
747746
}
748747

749-
impl<A, T: Iterator<A>> Iterator<A> for SkipIterator<A, T> {
748+
impl<A, T: Iterator<A>> Iterator<A> for SkipIterator<T> {
750749
#[inline]
751750
fn next(&mut self) -> Option<A> {
752751
let mut next = self.iter.next();
@@ -773,13 +772,12 @@ impl<A, T: Iterator<A>> Iterator<A> for SkipIterator<A, T> {
773772
}
774773

775774
/// An iterator which only iterates over the first `n` iterations of `iter`.
776-
// FIXME #6967: Dummy A parameter to get around type inference bug
777-
pub struct TakeIterator<A, T> {
775+
pub struct TakeIterator<T> {
778776
priv iter: T,
779777
priv n: uint
780778
}
781779

782-
impl<A, T: Iterator<A>> Iterator<A> for TakeIterator<A, T> {
780+
impl<A, T: Iterator<A>> Iterator<A> for TakeIterator<T> {
783781
#[inline]
784782
fn next(&mut self) -> Option<A> {
785783
let next = self.iter.next();
@@ -947,7 +945,7 @@ mod tests {
947945
let ys = [13, 15, 16, 17, 19, 20, 30];
948946
let mut it = xs.iter().skip(5);
949947
let mut i = 0;
950-
for it.advance |&x| {
948+
for it.advance |&x: &uint| {
951949
assert_eq!(x, ys[i]);
952950
i += 1;
953951
}
@@ -960,7 +958,7 @@ mod tests {
960958
let ys = [0u, 1, 2, 3, 5];
961959
let mut it = xs.iter().take(5);
962960
let mut i = 0;
963-
for it.advance |&x| {
961+
for it.advance |&x: &uint| {
964962
assert_eq!(x, ys[i]);
965963
i += 1;
966964
}

0 commit comments

Comments
 (0)