summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2024-12-11 13:52:34 +0100
committerHampusM <hampus@hampusmat.com>2024-12-11 13:52:34 +0100
commit33cc01562c4aef94e605c9dc675450031a840d72 (patch)
treedad9369cb63d637ac5b0f4abd6c36c57a800b9a8
parent9e057e9249fb5a8a9f3b2ba00a993049f733c9dd (diff)
refactor(ecs): make system::Param trait not unsafe
-rw-r--r--ecs/src/actions.rs2
-rw-r--r--ecs/src/component/local.rs2
-rw-r--r--ecs/src/query.rs3
-rw-r--r--ecs/src/sole.rs2
-rw-r--r--ecs/src/system.rs2
5 files changed, 5 insertions, 6 deletions
diff --git a/ecs/src/actions.rs b/ecs/src/actions.rs
index 0878067..1ed49a8 100644
--- a/ecs/src/actions.rs
+++ b/ecs/src/actions.rs
@@ -92,7 +92,7 @@ impl<'world> Actions<'world>
}
}
-unsafe impl<'world> SystemParam<'world> for Actions<'world>
+impl<'world> SystemParam<'world> for Actions<'world>
{
type Flags = NoInitParamFlag;
type Input = ();
diff --git a/ecs/src/component/local.rs b/ecs/src/component/local.rs
index 20627bf..aac4255 100644
--- a/ecs/src/component/local.rs
+++ b/ecs/src/component/local.rs
@@ -11,7 +11,7 @@ pub struct Local<'world, LocalComponent: Component>
local_component: ComponentRefMut<'world, LocalComponent>,
}
-unsafe impl<'world, LocalComponent> SystemParam<'world> for Local<'world, LocalComponent>
+impl<'world, LocalComponent> SystemParam<'world> for Local<'world, LocalComponent>
where
LocalComponent: Component,
{
diff --git a/ecs/src/query.rs b/ecs/src/query.rs
index f3318bd..0a9eca1 100644
--- a/ecs/src/query.rs
+++ b/ecs/src/query.rs
@@ -156,8 +156,7 @@ where
}
}
-unsafe impl<'world, Comps, OptionsT> SystemParam<'world>
- for Query<'world, Comps, OptionsT>
+impl<'world, Comps, OptionsT> SystemParam<'world> for Query<'world, Comps, OptionsT>
where
Comps: ComponentSequence,
OptionsT: Options,
diff --git a/ecs/src/sole.rs b/ecs/src/sole.rs
index 084a06b..b7c9a68 100644
--- a/ecs/src/sole.rs
+++ b/ecs/src/sole.rs
@@ -88,7 +88,7 @@ where
}
}
-unsafe impl<'world, SoleT> SystemParam<'world> for Single<'world, SoleT>
+impl<'world, SoleT> SystemParam<'world> for Single<'world, SoleT>
where
SoleT: Sole,
{
diff --git a/ecs/src/system.rs b/ecs/src/system.rs
index e273428..f266095 100644
--- a/ecs/src/system.rs
+++ b/ecs/src/system.rs
@@ -153,7 +153,7 @@ impl Debug for TypeErased
type TypeErasedRunFn = dyn Fn(&dyn Any, &World) + RefUnwindSafe + UnwindSafe;
/// A parameter to a [`System`].
-pub unsafe trait Param<'world>
+pub trait Param<'world>
{
type Input;
type Flags;