]> git.lizzy.rs Git - rust.git/commitdiff
std: Improve the documentation for iterator::Invert
authorblake2-ppc <blake2-ppc>
Sat, 3 Aug 2013 19:34:00 +0000 (21:34 +0200)
committerblake2-ppc <blake2-ppc>
Tue, 6 Aug 2013 02:05:08 +0000 (04:05 +0200)
src/libstd/iterator.rs

index bf55b4f7ce2e311d7424866778a163c338e9fa1b..56a0dca56679ccf3a34d89038944614d0c497263 100644 (file)
@@ -82,6 +82,17 @@ pub trait DoubleEndedIteratorUtil {
 /// In the future these will be default methods instead of a utility trait.
 impl<A, T: DoubleEndedIterator<A>> DoubleEndedIteratorUtil for T {
     /// Flip the direction of the iterator
+    ///
+    /// The inverted iterator flips the ends on an iterator that can already
+    /// be iterated from the front and from the back.
+    ///
+    ///
+    /// If the iterator also implements RandomAccessIterator, the inverted
+    /// iterator is also random access, with the indices starting at the back
+    /// of the original iterator.
+    ///
+    /// Note: Random access with inverted indices still only applies to the first
+    /// `uint::max_value` elements of the original iterator.
     #[inline]
     fn invert(self) -> Invert<T> {
         Invert{iter: self}