diff --git a/src/sizes.rs b/src/sizes.rs index 1518921..fb0b89a 100644 --- a/src/sizes.rs +++ b/src/sizes.rs @@ -16,28 +16,6 @@ macro_rules! impl_array_size { impl ArrayOps for Array { const SIZE: usize = $len; - #[inline] - fn as_core_array(&self) -> &[T; $len] { - &self.0 - } - - #[inline] - fn as_mut_core_array(&mut self) -> &mut [T; $len] { - &mut self.0 - } - - #[inline] - fn ref_from_core_array(array_ref: &[T; $len]) -> &Self { - // SAFETY: `Self` is a `repr(transparent)` newtype for `[T; $len]` - unsafe { &*array_ref.as_ptr().cast() } - } - - #[inline] - fn ref_mut_from_core_array(array_ref: &mut [T; $len]) -> &mut Self { - // SAFETY: `Self` is a `repr(transparent)` newtype for `[T; $len]` - unsafe { &mut *array_ref.as_mut_ptr().cast() } - } - #[inline] fn map_to_core_array(self, f: F) -> [U; $len] where diff --git a/src/traits.rs b/src/traits.rs index 864eee4..1933b85 100644 --- a/src/traits.rs +++ b/src/traits.rs @@ -56,18 +56,6 @@ pub trait ArrayOps: /// Not to be confused with [`AssociatedArraySize::Size`], which is [`typenum`]-based. const SIZE: usize; - /// Returns a reference to the inner array. - fn as_core_array(&self) -> &[T; N]; - - /// Returns a mutable reference to the inner array. - fn as_mut_core_array(&mut self) -> &mut [T; N]; - - /// Create array reference from reference to Rust's core array type. - fn ref_from_core_array(arr: &[T; N]) -> &Self; - - /// Create mutable array reference from reference to Rust's core array type. - fn ref_mut_from_core_array(arr: &mut [T; N]) -> &mut Self; - /// Returns an array of the same size as `self`, with function `f` applied to each element /// in order. fn map_to_core_array(self, f: F) -> [U; N] @@ -90,26 +78,6 @@ pub trait ArrayOps: impl ArrayOps for [T; N] { const SIZE: usize = N; - #[inline] - fn as_core_array(&self) -> &[T; N] { - self - } - - #[inline] - fn as_mut_core_array(&mut self) -> &mut [T; N] { - self - } - - #[inline] - fn ref_from_core_array(array_ref: &[T; N]) -> &Self { - array_ref - } - - #[inline] - fn ref_mut_from_core_array(array_ref: &mut [T; N]) -> &mut Self { - array_ref - } - #[inline] fn map_to_core_array(self, f: F) -> [U; N] where