Convert Into<Box<[T]>> for Vec<T> into From<Vec<T>> for Box<[T]>

This commit is contained in:
Oliver Middleton 2017-06-17 16:56:05 +01:00
parent dfb8c80e11
commit 222a328f5c

View file

@ -2124,10 +2124,12 @@ fn from(s: Box<[T]>) -> Vec<T> {
} }
} }
#[stable(feature = "box_from_vec", since = "1.18.0")] // note: test pulls in libstd, which causes errors here
impl<T> Into<Box<[T]>> for Vec<T> { #[cfg(not(test))]
fn into(self) -> Box<[T]> { #[stable(feature = "box_from_vec", since = "1.20.0")]
self.into_boxed_slice() impl<T> From<Vec<T>> for Box<[T]> {
fn from(v: Vec<T>) -> Box<[T]> {
v.into_boxed_slice()
} }
} }