Skip to content

Commit 569ceac

Browse files
committed
---
yaml --- r: 145081 b: refs/heads/try2 c: 3aead52 h: refs/heads/master i: 145079: dbaaab4 v: v3
1 parent d5e8d4c commit 569ceac

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
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 10c8978edbb53fda8b33758a0bf3f9154b20dc9e
8+
refs/heads/try2: 3aead52586d26f375e6318fb6980280db18b70b7
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/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)