From 6a5b418fbc9c5f42d35e7b417869b0cdaa1ee68a Mon Sep 17 00:00:00 2001 From: Philippe Renon Date: Thu, 19 Nov 2020 11:56:58 +0100 Subject: [PATCH] clippy: fix ptr_offset_with_cast warnings --- src/base/storage.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/base/storage.rs b/src/base/storage.rs index c09551c0..038884e3 100644 --- a/src/base/storage.rs +++ b/src/base/storage.rs @@ -72,7 +72,7 @@ pub unsafe trait Storage: Debug + Sized { /// Gets the address of the i-th matrix component without performing bound-checking. #[inline] unsafe fn get_address_unchecked_linear(&self, i: usize) -> *const N { - self.ptr().wrapping_offset(i as isize) + self.ptr().wrapping_add(i) } /// Gets the address of the i-th matrix component without performing bound-checking. @@ -124,7 +124,7 @@ pub unsafe trait StorageMut: Storage { /// Gets the mutable address of the i-th matrix component without performing bound-checking. #[inline] unsafe fn get_address_unchecked_linear_mut(&mut self, i: usize) -> *mut N { - self.ptr_mut().wrapping_offset(i as isize) + self.ptr_mut().wrapping_add(i) } /// Gets the mutable address of the i-th matrix component without performing bound-checking.