From 337b2073ea9ad8609a96cb4d72a8c98857d253f3 Mon Sep 17 00:00:00 2001 From: AlephCubed Date: Sun, 28 Dec 2025 18:39:03 -0800 Subject: [PATCH] Fix clippy issues. --- src/command.rs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/command.rs b/src/command.rs index 745c8fb..a7acb84 100644 --- a/src/command.rs +++ b/src/command.rs @@ -87,7 +87,7 @@ impl AddEffectCommand { .components() .get_info(*component_id) .and_then(|info| info.type_id()) - .and_then(|id| registry.merges.get(&id).map(|f| *f)) + .and_then(|id| registry.merges.get(&id).copied()) }) .collect(); @@ -101,7 +101,7 @@ impl AddEffectCommand { } impl Command for AddEffectCommand { - fn apply(self, world: &mut World) -> () { + fn apply(self, world: &mut World) { if self.bundle.mode == EffectMode::Stack { self.spawn(world); return; @@ -119,19 +119,17 @@ impl Command for AddEffectCommand { // 1. effecting the same target, // 2. and has the same name (ID). let old_entity = effected_by.iter().find_map(|entity| { - let Some(other_mode) = world.get::(*entity) else { - return None; - }; + let other_mode = world.get::(*entity)?; // Todo Think more about. if self.bundle.mode != *other_mode { return None; } - if let Some(name) = world.get::(*entity) { - if name == &self.bundle.name { - return Some(*entity); - } + let name = world.get::(*entity)?; + + if name == &self.bundle.name { + return Some(*entity); } None