diff options
| author | bors <bors@rust-lang.org> | 2013-08-01 12:52:29 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-08-01 12:52:29 -0700 |
| commit | 82b24559e6aa0914f8a49e0a9dbfb3cf35372515 (patch) | |
| tree | c2b0ff9b26400eac3f3405d78fe89dc07607c3ae /src/libstd/iterator.rs | |
| parent | 479809a267dbbcc3e2ec87da677c63430d3d229a (diff) | |
| parent | 94f1a5d6f8ecd30c6f59dfeaacdd5962f58bc44c (diff) | |
| download | rust-82b24559e6aa0914f8a49e0a9dbfb3cf35372515.tar.gz rust-82b24559e6aa0914f8a49e0a9dbfb3cf35372515.zip | |
auto merge of #8190 : thestinger/rust/for, r=thestinger
Diffstat (limited to 'src/libstd/iterator.rs')
| -rw-r--r-- | src/libstd/iterator.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libstd/iterator.rs b/src/libstd/iterator.rs index 84923876cbf..013901d57f8 100644 --- a/src/libstd/iterator.rs +++ b/src/libstd/iterator.rs @@ -18,7 +18,6 @@ implementing the `Iterator` trait. */ use cmp; -use iter::Times; use num::{Zero, One}; use option::{Option, Some, None}; use ops::{Add, Mul}; @@ -1229,8 +1228,9 @@ impl<A, T: Iterator<A>> Iterator<A> for Skip<T> { if self.n == 0 { next } else { - let n = self.n; - for n.times { + let mut n = self.n; + while n > 0 { + n -= 1; match next { Some(_) => { next = self.iter.next(); |
