diff --git a/library/alloc/src/vec/mod.rs b/library/alloc/src/vec/mod.rs index 1b78356fde5bc..e459442dfcfc5 100644 --- a/library/alloc/src/vec/mod.rs +++ b/library/alloc/src/vec/mod.rs @@ -2810,8 +2810,7 @@ impl From> for Vec { /// 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() } }