From b5cd81d0e54fb2310ce0de6f746957501130ce5f Mon Sep 17 00:00:00 2001 From: blake2-ppc Date: Sat, 3 Aug 2013 21:34:00 +0200 Subject: [PATCH] std: Improve the documentation for iterator::Invert --- src/libstd/iterator.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/libstd/iterator.rs b/src/libstd/iterator.rs index bf55b4f7ce2e..56a0dca56679 100644 --- a/src/libstd/iterator.rs +++ b/src/libstd/iterator.rs @@ -82,6 +82,17 @@ pub trait DoubleEndedIteratorUtil { /// In the future these will be default methods instead of a utility trait. impl> 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 { Invert{iter: self}