Skip to content

Commit b5cd81d

Browse files
author
blake2-ppc
committed
std: Improve the documentation for iterator::Invert
1 parent 520f292 commit b5cd81d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/libstd/iterator.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,17 @@ pub trait DoubleEndedIteratorUtil {
8282
/// In the future these will be default methods instead of a utility trait.
8383
impl<A, T: DoubleEndedIterator<A>> DoubleEndedIteratorUtil for T {
8484
/// Flip the direction of the iterator
85+
///
86+
/// The inverted iterator flips the ends on an iterator that can already
87+
/// be iterated from the front and from the back.
88+
///
89+
///
90+
/// If the iterator also implements RandomAccessIterator, the inverted
91+
/// iterator is also random access, with the indices starting at the back
92+
/// of the original iterator.
93+
///
94+
/// Note: Random access with inverted indices still only applies to the first
95+
/// `uint::max_value` elements of the original iterator.
8596
#[inline]
8697
fn invert(self) -> Invert<T> {
8798
Invert{iter: self}

0 commit comments

Comments
 (0)