Skip to content

Commit 9ef7a1c

Browse files
committed
---
yaml --- r: 80786 b: refs/heads/try c: 3aead52 h: refs/heads/master v: v3
1 parent 8095428 commit 9ef7a1c

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 4c6bf4872012c010f84dc7fa2cdfe87522533f89
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: cbd1eefbd350797b783df119fed7956d7e1c74ad
5-
refs/heads/try: 10c8978edbb53fda8b33758a0bf3f9154b20dc9e
5+
refs/heads/try: 3aead52586d26f375e6318fb6980280db18b70b7
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/libstd/iter.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1719,6 +1719,20 @@ pub fn count<A>(start: A, step: A) -> Counter<A> {
17191719
Counter{state: start, step: step}
17201720
}
17211721

1722+
impl<A: Add<A, A> + Clone> Iterator<A> for Counter<A> {
1723+
#[inline]
1724+
fn next(&mut self) -> Option<A> {
1725+
let result = self.state.clone();
1726+
self.state = self.state + self.step;
1727+
Some(result)
1728+
}
1729+
1730+
#[inline]
1731+
fn size_hint(&self) -> (uint, Option<uint>) {
1732+
(uint::max_value, None) // Too bad we can't specify an infinite lower bound
1733+
}
1734+
}
1735+
17221736
/// An iterator over the range [start, stop)
17231737
#[deriving(Clone, DeepClone)]
17241738
pub struct Range<A> {
@@ -1824,20 +1838,6 @@ impl<A: Sub<A, A> + Integer + Ord + Clone> DoubleEndedIterator<A> for RangeInclu
18241838
}
18251839
}
18261840

1827-
impl<A: Add<A, A> + Clone> Iterator<A> for Counter<A> {
1828-
#[inline]
1829-
fn next(&mut self) -> Option<A> {
1830-
let result = self.state.clone();
1831-
self.state = self.state + self.step;
1832-
Some(result)
1833-
}
1834-
1835-
#[inline]
1836-
fn size_hint(&self) -> (uint, Option<uint>) {
1837-
(uint::max_value, None) // Too bad we can't specify an infinite lower bound
1838-
}
1839-
}
1840-
18411841
/// An iterator that repeats an element endlessly
18421842
#[deriving(Clone, DeepClone)]
18431843
pub struct Repeat<A> {

0 commit comments

Comments
 (0)