rust/hwphysics/src/data.rs
changeset 15380 6e3e5be8b2e2
parent 15379 27915135f87f
child 15381 52844baced17
--- a/rust/hwphysics/src/data.rs	Wed Aug 28 22:53:40 2019 +0300
+++ b/rust/hwphysics/src/data.rs	Wed Aug 28 23:06:34 2019 +0300
@@ -23,10 +23,8 @@
 
             unsafe fn iter<F: FnMut(GearId, Self)>(slices: &[*mut u8], count: usize, mut f: F) {
                 for i in 0..count {
-                    unsafe {
-                        f(*(*slices.get_unchecked(0) as *const GearId).add(i),
-                          ($(&*(*slices.get_unchecked($n + 1) as *mut $t).add(i)),+,));
-                    }
+                    f(*(*slices.get_unchecked(0) as *const GearId).add(i),
+                      ($(&*(*slices.get_unchecked($n + 1) as *mut $t).add(i)),+,));
                 }
             }
         }
@@ -38,10 +36,8 @@
 
             unsafe fn iter<F: FnMut(GearId, Self)>(slices: &[*mut u8], count: usize, mut f: F) {
                 for i in 0..count {
-                    unsafe {
-                        f(*(*slices.get_unchecked(0) as *const GearId).add(i),
-                          ($(&mut *(*slices.get_unchecked($n + 1) as *mut $t).add(i)),+,));
-                    }
+                    f(*(*slices.get_unchecked(0) as *const GearId).add(i),
+                      ($(&mut *(*slices.get_unchecked($n + 1) as *mut $t).add(i)),+,));
                 }
             }
         }
@@ -382,7 +378,6 @@
         }
     }
 
-
     pub fn iter<T: TypeTuple + 'static, F: FnMut(T)>(&mut self, mut f: F) {
         self.iter_id(|_, x| f(x));
     }