Skip to content

Commit

Permalink
::core
Browse files Browse the repository at this point in the history
  • Loading branch information
Manishearth committed Jun 8, 2023
1 parent 53b410b commit 12026a5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion utils/zerovec/src/ule/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ pub unsafe trait VarULE: 'static {
#[inline]
fn to_boxed(&self) -> Box<Self> {
let bytesvec = self.as_byte_slice().to_owned().into_boxed_slice();
let bytesvec = ::core::mem::ManuallyDrop::new(bytesvec);
let bytesvec = mem::ManuallyDrop::new(bytesvec);
unsafe {
// Get the pointer representation
let ptr: *mut Self =
Expand Down
7 changes: 4 additions & 3 deletions utils/zerovec/src/zerovec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ use core::marker::PhantomData;
use core::mem;
use core::num::NonZeroUsize;
use core::ops::Deref;
use core::ptr;

/// A zero-copy, byte-aligned vector for fixed-width types.
///
Expand Down Expand Up @@ -292,8 +293,8 @@ where
// to ZeroVec, all other such operations should use this function
let capacity = vec.capacity();
let len = vec.len();
let ptr = ::core::mem::ManuallyDrop::new(vec).as_mut_ptr();
let slice = ::core::ptr::slice_from_raw_parts_mut(ptr, len);
let ptr = mem::ManuallyDrop::new(vec).as_mut_ptr();
let slice = ptr::slice_from_raw_parts_mut(ptr, len);
Self {
vector: EyepatchHackVector {
buf: slice,
Expand Down Expand Up @@ -894,7 +895,7 @@ where
/// the logical equivalent of this type's internal representation
#[inline]
pub fn into_cow(self) -> Cow<'a, [T::ULE]> {
let this = ::core::mem::ManuallyDrop::new(self);
let this = mem::ManuallyDrop::new(self);
if this.is_owned() {
let vec = unsafe {
// safe to call: we know it's owned,
Expand Down

0 comments on commit 12026a5

Please sign in to comment.