Skip to content

Commit

Permalink
fix(clippy): remove unnecessary derefs
Browse files Browse the repository at this point in the history
  • Loading branch information
jturner314 committed Jul 30, 2022
1 parent cc3719c commit cd7a206
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/dimension/dynindeximpl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ impl<T> Deref for IxDynRepr<T> {
debug_assert!(len as usize <= ar.len());
unsafe { ar.get_unchecked(..len as usize) }
}
IxDynRepr::Alloc(ref ar) => &*ar,
IxDynRepr::Alloc(ref ar) => ar,
}
}
}
Expand All @@ -33,7 +33,7 @@ impl<T> DerefMut for IxDynRepr<T> {
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,
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/dimension/ndindex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ unsafe impl<'a> NdIndex<IxDyn> for &'a IxDyn {

unsafe impl<'a> NdIndex<IxDyn> for &'a [Ix] {
fn index_checked(&self, dim: &IxDyn, strides: &IxDyn) -> Option<isize> {
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)
Expand Down

0 comments on commit cd7a206

Please sign in to comment.