Skip to content

Commit

Permalink
FIX: Remove unused .as_mut_ptr() on the Array trait
Browse files Browse the repository at this point in the history
Raw pointer taking should go through the MaybeUninit wrappers around the
arrays anyway, when it is partially uninitialized, which it often is.

The remaining .as_ptr() and .as_slice() methods on Array is only used
on a fully initialized array in ArrayString::from_byte_string
  • Loading branch information
bluss committed Dec 1, 2018
1 parent c321bf2 commit 6bb1406
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions src/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ pub unsafe trait Array {
#[doc(hidden)]
fn as_ptr(&self) -> *const Self::Item;
#[doc(hidden)]
fn as_mut_ptr(&mut self) -> *mut Self::Item;
#[doc(hidden)]
fn capacity() -> usize;
}

Expand Down Expand Up @@ -99,9 +97,6 @@ macro_rules! fix_array_impl {
fn as_ptr(&self) -> *const T { self as *const _ as *const _ }
#[doc(hidden)]
#[inline(always)]
fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut _}
#[doc(hidden)]
#[inline(always)]
fn capacity() -> usize { $len }
}
)
Expand Down

0 comments on commit 6bb1406

Please sign in to comment.