diff options
author | HampusM <hampus@hampusmat.com> | 2024-06-20 21:32:46 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2024-06-20 21:32:46 +0200 |
commit | 681fca5c465191e37714ed07937efec8b0c8b197 (patch) | |
tree | fd609df5737a678a32c2bbe17315f1e163a23d48 /ecs/src/system/stateful.rs | |
parent | 87a4230d5cbe8741c88edecbecff510bc1736fef (diff) |
refactor(ecs): fix Clippy lints
Diffstat (limited to 'ecs/src/system/stateful.rs')
-rw-r--r-- | ecs/src/system/stateful.rs | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/ecs/src/system/stateful.rs b/ecs/src/system/stateful.rs index 49fd3bf..56c9d4f 100644 --- a/ecs/src/system/stateful.rs +++ b/ecs/src/system/stateful.rs @@ -114,30 +114,26 @@ macro_rules! impl_system { run: Box::new(|data, world_data| { // SAFETY: The caller of TypeErased::run ensures the lifetime // is correct - let data = unsafe { &*(data as *const dyn Any) }; + let data = unsafe { &*std::ptr::from_ref::<dyn Any>(data) }; let me = data.downcast_ref::<Self>().unwrap(); // SAFETY: The caller of TypeErased::run ensures the lifetime // is correct - let world_data = unsafe { - &*(world_data as *const WorldData) - }; + let world_data = unsafe { &*std::ptr::from_ref(world_data) }; me.run(world_data); }), prepare: Box::new(|data, world_data| { // SAFETY: The caller of TypeErased::run ensures the lifetime // is correct - let data = unsafe { &*(data as *const dyn Any) }; + let data = unsafe { &*std::ptr::from_ref::<dyn Any>(data) }; let me = data.downcast_ref::<Self>().unwrap(); // SAFETY: The caller of TypeErased::run ensures the lifetime // is correct - let world_data = unsafe { - &*(world_data as *const WorldData) - }; + let world_data = unsafe { &*std::ptr::from_ref(world_data) }; me.prepare(world_data); }), |