FIX: Remove unused .as_mut_ptr() on the Array trait
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
This commit is contained in:
@@ -23,8 +23,6 @@ pub unsafe trait Array {
|
|||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
fn as_ptr(&self) -> *const Self::Item;
|
fn as_ptr(&self) -> *const Self::Item;
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
fn as_mut_ptr(&mut self) -> *mut Self::Item;
|
|
||||||
#[doc(hidden)]
|
|
||||||
fn capacity() -> usize;
|
fn capacity() -> usize;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -99,9 +97,6 @@ macro_rules! fix_array_impl {
|
|||||||
fn as_ptr(&self) -> *const T { self as *const _ as *const _ }
|
fn as_ptr(&self) -> *const T { self as *const _ as *const _ }
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut _}
|
|
||||||
#[doc(hidden)]
|
|
||||||
#[inline(always)]
|
|
||||||
fn capacity() -> usize { $len }
|
fn capacity() -> usize { $len }
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user