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:
commit
5b7c98676f
1 changed files with 1 additions and 2 deletions
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue