X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibcollections%2Fvec.rs;h=6ee7b0a86c8edaa3a5073a8da8bb8f6b6178c01d;hb=9fc51efe3344a32d9e522f08383f052277b6ab63;hp=14bc7f65e096020afd05cfc635abd91993a7b1c7;hpb=6cf3b0b74aadcc1fe87adbd2c74876a1f6c920b3;p=rust.git diff --git a/src/libcollections/vec.rs b/src/libcollections/vec.rs index 14bc7f65e09..6ee7b0a86c8 100644 --- a/src/libcollections/vec.rs +++ b/src/libcollections/vec.rs @@ -423,11 +423,18 @@ pub fn truncate(&mut self, len: usize) { } } + /// Extract a slice containing the entire vector. + #[inline] + #[unstable(feature = "convert", + reason = "waiting on RFC revision")] + pub fn as_slice(&self) -> &[T] { + self + } + /// Deprecated: use `&mut s[..]` instead. #[inline] - #[unstable(feature = "collections", - reason = "will be replaced by slice syntax")] - #[deprecated(since = "1.0.0", reason = "use &mut s[..] instead")] + #[unstable(feature = "convert", + reason = "waiting on RFC revision")] pub fn as_mut_slice(&mut self) -> &mut [T] { &mut self[..] } @@ -1640,13 +1647,6 @@ fn as_ref(&self) -> &Vec { } } -#[stable(feature = "rust1", since = "1.0.0")] -impl Into> for Vec { - fn into(self) -> Vec { - self - } -} - #[stable(feature = "rust1", since = "1.0.0")] impl AsRef<[T]> for Vec { fn as_ref(&self) -> &[T] {