From 7a7d3a350b22b5555c27debff6fee4fc6100fa38 Mon Sep 17 00:00:00 2001 From: HampusM Date: Tue, 18 Mar 2025 13:21:46 +0100 Subject: refactor(ecs): fix Clippy lints --- ecs/src/component.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'ecs/src/component.rs') diff --git a/ecs/src/component.rs b/ecs/src/component.rs index f77b55a..77046d0 100644 --- a/ecs/src/component.rs +++ b/ecs/src/component.rs @@ -228,11 +228,13 @@ pub struct Metadata impl Metadata { + #[must_use] pub fn new_non_optional(id: Uid) -> Self { Self { id, is_optional: false } } + #[must_use] pub fn get(component: &ComponentT) -> Self { Self { @@ -241,6 +243,7 @@ impl Metadata } } + #[must_use] pub fn of() -> Self { Self { @@ -268,6 +271,10 @@ pub trait FromOptional<'comp> pub trait FromLockedOptional<'comp>: Sized { + /// Converts a reference to a optional locked boxed component to a instance of `Self`. + /// + /// # Errors + /// Returns `Err` if taking the lock (in a non-blocking way) fails. fn from_locked_optional_component( optional_component: Option<&'comp Lock>>, world: &'comp World, @@ -406,6 +413,5 @@ impl RefSequence for () _world: &'component World, ) -> Self::Handles<'component> { - () } } -- cgit v1.2.3-18-g5258