From 7003d9de96824f3e1cb67d56c1c4be883f6e2520 Mon Sep 17 00:00:00 2001 From: HampusM Date: Mon, 21 Sep 2026 23:42:32 +0200 Subject: refactor(engine-ecs): fix clippy lints --- engine-ecs/src/component.rs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'engine-ecs/src/component.rs') diff --git a/engine-ecs/src/component.rs b/engine-ecs/src/component.rs index c76c48e..400b12c 100644 --- a/engine-ecs/src/component.rs +++ b/engine-ecs/src/component.rs @@ -101,6 +101,10 @@ impl<'comp, DataT: 'static> Handle<'comp, DataT> impl<'comp> Handle<'comp, dyn Any> { + /// Creates a handle to a untyped component. + /// + /// # Errors + /// Will return `Err` if acquiring the component's lock fails. pub fn new_any( entity_component_ref: &EntityComponentRef<'comp>, ) -> Result @@ -164,6 +168,10 @@ impl<'comp, DataT: 'static> HandleMut<'comp, DataT> impl<'comp> HandleMut<'comp, dyn Any> { + /// Creates a handle to a untyped component. + /// + /// # Errors + /// Will return `Err` if acquiring the component's lock fails. pub fn new_any( entity_component_ref: &EntityComponentRef<'comp>, world: &'comp World, @@ -182,7 +190,7 @@ impl<'comp> HandleMut<'comp, dyn Any> } } -impl<'comp, DataT: ?Sized + 'static> HandleMut<'comp, DataT> +impl HandleMut<'_, DataT> { pub fn set_changed(&self) { @@ -249,6 +257,13 @@ pub struct Parts impl Parts { + /// Creates components parts from the component information stored in + /// `component_info`. + /// + /// # Panics + /// This function will panic if the type ID of the value in `data` does not equal + /// to the type ID stored in `component_info`. + #[must_use] pub fn from_component_info(component_info: &Info, id: Uid, data: Box) -> Self { -- cgit v1.2.3-18-g5258