Skip to content

Commit 51e0d1c

Browse files
committed
Clean up the example on slice::IterMut::as_slice()
1 parent 5384a11 commit 51e0d1c

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/libcore/slice/mod.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3300,20 +3300,16 @@ impl<'a, T> IterMut<'a, T> {
33003300
///
33013301
/// ```
33023302
/// # #![feature(slice_iter_mut_as_slice)]
3303-
/// // First, we declare a type which has `iter_mut` method to get the `IterMut`
3304-
/// // struct (&[usize here]):
33053303
/// let mut slice: &mut [usize] = &mut [1, 2, 3];
33063304
///
3307-
/// // Then, we get the iterator:
3305+
/// // First, we get the iterator:
33083306
/// let mut iter = slice.iter_mut();
3309-
/// // So if we print what the `as_slice` method returns here, we have "[1, 2, 3]":
3310-
/// println!("{:?}", iter.as_slice());
3307+
/// // So if we check what the `as_slice` method returns here, we have "[1, 2, 3]":
33113308
/// assert_eq!(iter.as_slice(), &[1, 2, 3]);
33123309
///
33133310
/// // Next, we move to the second element of the slice:
33143311
/// iter.next();
33153312
/// // Now `as_slice` returns "[2, 3]":
3316-
/// println!("{:?}", iter.as_slice());
33173313
/// assert_eq!(iter.as_slice(), &[2, 3]);
33183314
/// ```
33193315
#[unstable(feature = "slice_iter_mut_as_slice", reason = "recently added", issue = "0")]

0 commit comments

Comments
 (0)