Rollup merge of #84248 - calebsander:refactor/vec-functions, r=Amanieu

Remove duplicated fn(Box<[T]>) -> Vec<T>

`<[T]>::into_vec()` does the same thing as `Vec::from::<Box<[T]>>()`, so they can be implemented in terms of each other. This was the previous implementation of `Vec::from()`, but was changed in #78461. I'm not sure what the rationale was for that change, but it seems preferable to maintain a single implementation.
This commit is contained in:
Yuki Okushi 2021-04-24 03:44:04 +09:00 committed by GitHub
commit 5b7c98676f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2810,8 +2810,7 @@ impl<T, A: Allocator> From<Box<[T], A>> for Vec<T, A> {
/// assert_eq!(Vec::from(b), vec![1, 2, 3]);
/// ```
fn from(s: Box<[T], A>) -> Self {
let len = s.len();
Self { buf: RawVec::from_box(s), len }
s.into_vec()
}
}