about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorDaniel Micay <danielmicay@gmail.com>2013-09-14 16:34:32 -0400
committerDaniel Micay <danielmicay@gmail.com>2013-09-14 16:51:33 -0400
commit10c8978edbb53fda8b33758a0bf3f9154b20dc9e (patch)
tree80781d4da62c9c5c3c94dc49f157c271f7e2b6b2 /src
parent561f1b006321501dfe5a059444fc8f560010c2ba (diff)
downloadrust-10c8978edbb53fda8b33758a0bf3f9154b20dc9e.tar.gz
rust-10c8978edbb53fda8b33758a0bf3f9154b20dc9e.zip
iter: replace comment with a docstring
Diffstat (limited to 'src')
-rw-r--r--src/libstd/iter.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/libstd/iter.rs b/src/libstd/iter.rs
index a0de8b1efad..8407b068344 100644
--- a/src/libstd/iter.rs
+++ b/src/libstd/iter.rs
@@ -1749,14 +1749,12 @@ impl<A: Add<A, A> + Ord + Clone> Iterator<A> for Range<A> {
     // Blocked on #8605 Need numeric trait for converting to `Option<uint>`
 }
 
-impl<A: Sub<A, A> + Integer + Ord + Clone> DoubleEndedIterator<A> for Range<A> {
+/// `Integer` is required to ensure the range will be the same regardless of
+/// the direction it is consumed.
+impl<A: Integer + Ord + Clone> DoubleEndedIterator<A> for Range<A> {
     #[inline]
     fn next_back(&mut self) -> Option<A> {
         if self.stop > self.state {
-            // Integer doesn't technically define this rule, but we're going to assume that every
-            // Integer is reachable from every other one by adding or subtracting enough Ones. This
-            // seems like a reasonable-enough rule that every Integer should conform to, even if it
-            // can't be statically checked.
             self.stop = self.stop - self.one;
             Some(self.stop.clone())
         } else {