Skip to content

Commit

Permalink
refactor: small mistakes
Browse files Browse the repository at this point in the history
  • Loading branch information
bluurryy committed Oct 14, 2024
1 parent 8a2d880 commit 0b53a32
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
2 changes: 1 addition & 1 deletion src/fixed_bump_vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1273,7 +1273,7 @@ impl<'a, T> FixedBumpVec<'a, T> {
}

#[inline(always)]
fn from_raw_parts(initialized: BumpBox<'a, [T]>, capacity: usize) -> Self {
unsafe fn from_raw_parts(initialized: BumpBox<'a, [T]>, capacity: usize) -> Self {
Self { initialized, capacity }
}

Expand Down
10 changes: 0 additions & 10 deletions src/polyfill/nonnull.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,16 +269,6 @@ pub(crate) unsafe fn truncate<T>(slice: &mut NonNull<[T]>, len: usize) {
drop_in_place(to_drop);
}

#[allow(unused_macros)]
macro_rules! addr_of {
($ptr:ident.$member:ident) => {{
NonNull::new_unchecked(core::ptr::addr_of_mut!((*$ptr.as_ptr()).$member))
}};
}

#[allow(unused_imports)]
pub(crate) use addr_of;

/// like `<NonNull<T> as From<&T>>::from` but `const`
pub(crate) const fn from_ref<T>(r: &T) -> NonNull<T> {
unsafe { NonNull::new_unchecked(r as *const T as *mut T) }
Expand Down

0 comments on commit 0b53a32

Please sign in to comment.