From f5290c1eeac18a6c5837b9219e8e4ad4be25a91d Mon Sep 17 00:00:00 2001 From: bluss Date: Sat, 1 Dec 2018 12:01:09 +0100 Subject: [PATCH] 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 --- src/array.rs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/array.rs b/src/array.rs index b6ccd01..ad18c79 100644 --- a/src/array.rs +++ b/src/array.rs @@ -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; } @@ -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 } } )