--- 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));
}