diff --git a/util/src/new_uninit_slice.rs b/util/src/new_uninit_slice.rs index 60962b40..e032724b 100644 --- a/util/src/new_uninit_slice.rs +++ b/util/src/new_uninit_slice.rs @@ -1,10 +1,10 @@ use alloc::alloc::alloc; -use core::{alloc::Layout, mem::MaybeUninit}; +use core::{alloc::Layout, mem::MaybeUninit, slice}; use crate::prelude::*; // TODO: use `Box::new_uninit_slice` once stabilized // https://github.com/rust-lang/rust/issues/63291 pub fn new_uninit_slice(len: usize) -> Box<[MaybeUninit]> { - unsafe { Box::from_raw(core::slice::from_raw_parts_mut(alloc(Layout::array::(len).unwrap()).cast(), len)) } + unsafe { Box::from_raw(slice::from_raw_parts_mut(alloc(Layout::array::(len).unwrap()).cast(), len)) } }