From 5384a11fcaa71d74d93f7e4ea4a2662ae28698fe Mon Sep 17 00:00:00 2001 From: Mazdak Farrokhzad Date: Tue, 5 Mar 2019 16:17:50 -0800 Subject: [PATCH] Apply suggestions from code review Co-Authored-By: cuviper --- src/libcore/slice/mod.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libcore/slice/mod.rs b/src/libcore/slice/mod.rs index b48101c23dad..4bccd44f5036 100644 --- a/src/libcore/slice/mod.rs +++ b/src/libcore/slice/mod.rs @@ -3291,8 +3291,8 @@ impl<'a, T> IterMut<'a, T> { /// Views the underlying data as a subslice of the original data. /// - /// To avoid creating `&mut` references that alias, this has a - /// borrowed lifetime from the iterator. + /// To avoid creating `&mut [T]` references that alias, the returned slice + /// borrows its lifetime from the iterator the method is applied on. /// /// # Examples /// @@ -3302,11 +3302,11 @@ 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 [1, 2, 3]; + /// let mut slice: &mut [usize] = &mut [1, 2, 3]; /// /// // Then, we get the iterator: /// let mut iter = slice.iter_mut(); - /// // So if we print what `as_slice` method returns here, we have "[1, 2, 3]": + /// // So if we print what the `as_slice` method returns here, we have "[1, 2, 3]": /// println!("{:?}", iter.as_slice()); /// assert_eq!(iter.as_slice(), &[1, 2, 3]); ///