Skip to content

Commit 6bb1406

Browse files
committed
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
1 parent c321bf2 commit 6bb1406

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

src/array.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ pub unsafe trait Array {
2323
#[doc(hidden)]
2424
fn as_ptr(&self) -> *const Self::Item;
2525
#[doc(hidden)]
26-
fn as_mut_ptr(&mut self) -> *mut Self::Item;
27-
#[doc(hidden)]
2826
fn capacity() -> usize;
2927
}
3028

@@ -99,9 +97,6 @@ macro_rules! fix_array_impl {
9997
fn as_ptr(&self) -> *const T { self as *const _ as *const _ }
10098
#[doc(hidden)]
10199
#[inline(always)]
102-
fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut _}
103-
#[doc(hidden)]
104-
#[inline(always)]
105100
fn capacity() -> usize { $len }
106101
}
107102
)

0 commit comments

Comments
 (0)