diff --git a/src/vec.rs b/src/vec.rs index a77ba5248a..ace8179655 100644 --- a/src/vec.rs +++ b/src/vec.rs @@ -161,7 +161,7 @@ impl Vec { /// Extracts a mutable slice containing the entire vector. /// - /// Equivalent to `&s[..]`. + /// Equivalent to `&mut s[..]`. /// /// # Examples /// @@ -171,7 +171,7 @@ impl Vec { /// buffer[0] = 9; /// assert_eq!(buffer.as_slice(), &[9, 2, 3, 5, 8]); /// ``` - pub(crate) fn as_mut_slice(&mut self) -> &mut [T] { + pub fn as_mut_slice(&mut self) -> &mut [T] { // NOTE(unsafe) avoid bound checks in the slicing operation // &mut buffer[..self.len] unsafe { slice::from_raw_parts_mut(self.buffer.as_mut_ptr() as *mut T, self.len) }