From a6c8bd2147c9c3d8bb512bd3af084130135a257b Mon Sep 17 00:00:00 2001 From: Jim Turner Date: Sat, 30 Jul 2022 14:35:43 -0400 Subject: [PATCH] fix(clippy): remove unnecessary derefs --- src/dimension/dynindeximpl.rs | 4 ++-- src/dimension/ndindex.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dimension/dynindeximpl.rs b/src/dimension/dynindeximpl.rs index b75db91c5..85b34bdbe 100644 --- a/src/dimension/dynindeximpl.rs +++ b/src/dimension/dynindeximpl.rs @@ -21,7 +21,7 @@ impl Deref for IxDynRepr { debug_assert!(len as usize <= ar.len()); unsafe { ar.get_unchecked(..len as usize) } } - IxDynRepr::Alloc(ref ar) => &*ar, + IxDynRepr::Alloc(ref ar) => ar, } } } @@ -33,7 +33,7 @@ impl DerefMut for IxDynRepr { debug_assert!(len as usize <= ar.len()); unsafe { ar.get_unchecked_mut(..len as usize) } } - IxDynRepr::Alloc(ref mut ar) => &mut *ar, + IxDynRepr::Alloc(ref mut ar) => ar, } } } diff --git a/src/dimension/ndindex.rs b/src/dimension/ndindex.rs index 810a5b097..3a687c813 100644 --- a/src/dimension/ndindex.rs +++ b/src/dimension/ndindex.rs @@ -216,7 +216,7 @@ unsafe impl<'a> NdIndex for &'a IxDyn { unsafe impl<'a> NdIndex for &'a [Ix] { fn index_checked(&self, dim: &IxDyn, strides: &IxDyn) -> Option { - stride_offset_checked(dim.ix(), strides.ix(), *self) + stride_offset_checked(dim.ix(), strides.ix(), self) } fn index_unchecked(&self, strides: &IxDyn) -> isize { zip(strides.ix(), *self)