From 681fca5c465191e37714ed07937efec8b0c8b197 Mon Sep 17 00:00:00 2001 From: HampusM Date: Thu, 20 Jun 2024 21:32:46 +0200 Subject: refactor(ecs): fix Clippy lints --- ecs/src/system/stateful.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'ecs/src/system/stateful.rs') 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::(data) }; let me = data.downcast_ref::().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::(data) }; let me = data.downcast_ref::().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); }), -- cgit v1.2.3-18-g5258