From 786bf07e454b93dc20fa5ae1e5bc1fd11ae7d849 Mon Sep 17 00:00:00 2001 From: overlookmotel <557937+overlookmotel@users.noreply.github.com> Date: Wed, 14 Aug 2024 17:55:25 +0000 Subject: [PATCH] refactor(index): shorten code and correct comment (#4905) Style nit + comment correction. Plain `Box` is used everywhere else in this file, no need to fully specify `alloc::boxed::Box`. --- crates/oxc_index/src/lib.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/crates/oxc_index/src/lib.rs b/crates/oxc_index/src/lib.rs index 22f0504af..6d8f21be9 100644 --- a/crates/oxc_index/src/lib.rs +++ b/crates/oxc_index/src/lib.rs @@ -343,12 +343,11 @@ impl IndexVec { self.raw.pop() } - /// Converts the vector into an owned IdxSlice, dropping excess capacity. + /// Converts the vector into an owned [`IndexSlice`], dropping excess capacity. #[inline] - pub fn into_boxed_slice(self) -> alloc::boxed::Box> { + pub fn into_boxed_slice(self) -> Box> { let b = self.raw.into_boxed_slice(); // SAFETY: `IndexSlice` is a thin wrapper around `[T]` with the added marker for the index. - unsafe { Box::from_raw(Box::into_raw(b) as *mut IndexSlice) } }