@@ -109,19 +109,25 @@ impl<'a, T> Iter<'a, T> {
109109 /// Basic usage:
110110 ///
111111 /// ```
112- /// // First, we declare a type which has the `iter` method to get the `Iter`
112+ /// // First, we need a slice to call the `iter` method on:
113113 /// // struct (`&[usize]` here):
114114 /// let slice = &[1, 2, 3];
115115 ///
116- /// // Then, we get the iterator :
116+ /// // Then we call `iter` on the slice to get the `Iter` struct :
117117 /// let mut iter = slice.iter();
118- /// // So if we print what `as_slice` method returns here, we have "[1, 2, 3]":
118+ /// // Here `as_slice` still returns the whole slice, so this prints "[1, 2, 3]":
119119 /// println!("{:?}", iter.as_slice());
120120 ///
121- /// // Next , we move to the second element of the slice :
121+ /// // Now , we call the `next` method to remove the first element of the iterator :
122122 /// iter.next();
123- /// // Now `as_slice` returns "[2, 3]":
123+ /// // Here the iterator does not contain the first element of the slice any more,
124+ /// // so `as_slice` only returns the last two elements of the slice,
125+ /// // and so this prints "[2, 3]":
124126 /// println!("{:?}", iter.as_slice());
127+ ///
128+ /// // The underlying slice has not been modified and still contains three elements,
129+ /// // so this prints "[1, 2, 3]":
130+ /// println!("{:?}", slice);
125131 /// ```
126132 #[ must_use]
127133 #[ stable( feature = "iter_to_slice" , since = "1.4.0" ) ]
0 commit comments