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/component.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'ecs/src/component.rs') diff --git a/ecs/src/component.rs b/ecs/src/component.rs index 512c60d..be5756f 100644 --- a/ecs/src/component.rs +++ b/ecs/src/component.rs @@ -121,6 +121,7 @@ pub struct Id impl Id { + #[must_use] pub fn of() -> Self where ComponentT: Component, @@ -168,6 +169,7 @@ impl From for IsOptional /// Returns whether the given component type is a optional component. /// /// Will return `true` if the component is a [`Option`]. +#[must_use] pub fn is_optional() -> bool { if Id::of::() == Id::of::>() { @@ -177,7 +179,7 @@ pub fn is_optional() -> bool false } -pub trait FromOptionalComponent<'comp> +pub trait FromOptional<'comp> { fn from_optional_component( optional_component: Option>>, @@ -189,7 +191,7 @@ macro_rules! inner { seq!(I in 0..=$c { impl<#(Comp~I: Component,)*> Sequence for (#(Comp~I,)*) where - #(for<'comp> Comp~I::RefMut<'comp>: FromOptionalComponent<'comp>,)* + #(for<'comp> Comp~I::RefMut<'comp>: FromOptional<'comp>,)* { type Refs<'component> = (#(Comp~I::RefMut<'component>,)*) where Self: 'component; -- cgit v1.2.3-18-g5258