From 51e0d1c2990619ed55e0a387ae4fab71992069df Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Tue, 5 Mar 2019 16:20:50 -0800 Subject: [PATCH] Clean up the example on slice::IterMut::as_slice() --- src/libcore/slice/mod.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/libcore/slice/mod.rs b/src/libcore/slice/mod.rs index 4bccd44f5036a..5af6b9e8fe632 100644 --- a/src/libcore/slice/mod.rs +++ b/src/libcore/slice/mod.rs @@ -3300,20 +3300,16 @@ impl<'a, T> IterMut<'a, T> { /// /// ``` /// # #![feature(slice_iter_mut_as_slice)] - /// // First, we declare a type which has `iter_mut` method to get the `IterMut` - /// // struct (&[usize here]): /// let mut slice: &mut [usize] = &mut [1, 2, 3]; /// - /// // Then, we get the iterator: + /// // First, we get the iterator: /// let mut iter = slice.iter_mut(); - /// // So if we print what the `as_slice` method returns here, we have "[1, 2, 3]": - /// println!("{:?}", iter.as_slice()); + /// // So if we check what the `as_slice` method returns here, we have "[1, 2, 3]": /// assert_eq!(iter.as_slice(), &[1, 2, 3]); /// /// // Next, we move to the second element of the slice: /// iter.next(); /// // Now `as_slice` returns "[2, 3]": - /// println!("{:?}", iter.as_slice()); /// assert_eq!(iter.as_slice(), &[2, 3]); /// ``` #[unstable(feature = "slice_iter_mut_as_slice", reason = "recently added", issue = "0")]