提交 222a328f 编写于 作者: O Oliver Middleton

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

上级 dfb8c80e
......@@ -2124,10 +2124,12 @@ fn from(s: Box<[T]>) -> Vec<T> {
}
}
#[stable(feature = "box_from_vec", since = "1.18.0")]
impl<T> Into<Box<[T]>> for Vec<T> {
fn into(self) -> Box<[T]> {
self.into_boxed_slice()
// note: test pulls in libstd, which causes errors here
#[cfg(not(test))]
#[stable(feature = "box_from_vec", since = "1.20.0")]
impl<T> From<Vec<T>> for Box<[T]> {
fn from(v: Vec<T>) -> Box<[T]> {
v.into_boxed_slice()
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册