about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorDaniel Micay <danielmicay@gmail.com>2013-07-26 19:38:32 -0400
committerDaniel Micay <danielmicay@gmail.com>2013-07-27 14:36:52 -0400
commitd6bc438bbcb9240d0303ffec81bf1a617f0903a5 (patch)
treef11fdcb617dd8fa87a42991c670b6d2f20bbd396 /src/libstd
parent0522955d10f76ac2ca3182de9ff5b774982243cb (diff)
downloadrust-d6bc438bbcb9240d0303ffec81bf1a617f0903a5.tar.gz
rust-d6bc438bbcb9240d0303ffec81bf1a617f0903a5.zip
make RandomAccessIterator inherit from Iterator
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/iterator.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libstd/iterator.rs b/src/libstd/iterator.rs
index 36645a555bb..d3b2325fd9d 100644
--- a/src/libstd/iterator.rs
+++ b/src/libstd/iterator.rs
@@ -29,7 +29,7 @@ use uint;
 /// Conversion from an `Iterator`
 pub trait FromIterator<A, T: Iterator<A>> {
     /// Build a container with elements from an external iterator.
-    pub fn from_iterator(iterator: &mut T) -> Self;
+    fn from_iterator(iterator: &mut T) -> Self;
 }
 
 /// An interface for dealing with "external iterators". These types of iterators
@@ -52,7 +52,9 @@ pub trait DoubleEndedIterator<A>: Iterator<A> {
 }
 
 /// An object implementing random access indexing by `uint`
-pub trait RandomAccessIterator<A> {
+///
+/// A `RandomAccessIterator` should be either infinite or a `DoubleEndedIterator`.
+pub trait RandomAccessIterator<A>: Iterator<A> {
     /// Return the number of indexable elements. At most `std::uint::max_value`
     /// elements are indexable, even if the iterator represents a longer range.
     fn indexable(&self) -> uint;