Skip to content

Commit 10c8978

Browse files
committed
iter: replace comment with a docstring
1 parent 561f1b0 commit 10c8978

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/libstd/iter.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1749,14 +1749,12 @@ impl<A: Add<A, A> + Ord + Clone> Iterator<A> for Range<A> {
17491749
// Blocked on #8605 Need numeric trait for converting to `Option<uint>`
17501750
}
17511751

1752-
impl<A: Sub<A, A> + Integer + Ord + Clone> DoubleEndedIterator<A> for Range<A> {
1752+
/// `Integer` is required to ensure the range will be the same regardless of
1753+
/// the direction it is consumed.
1754+
impl<A: Integer + Ord + Clone> DoubleEndedIterator<A> for Range<A> {
17531755
#[inline]
17541756
fn next_back(&mut self) -> Option<A> {
17551757
if self.stop > self.state {
1756-
// Integer doesn't technically define this rule, but we're going to assume that every
1757-
// Integer is reachable from every other one by adding or subtracting enough Ones. This
1758-
// seems like a reasonable-enough rule that every Integer should conform to, even if it
1759-
// can't be statically checked.
17601758
self.stop = self.stop - self.one;
17611759
Some(self.stop.clone())
17621760
} else {

0 commit comments

Comments
 (0)