From 7eedb19a5f28150a28b8cf1ec5fb08139d6b5590 Mon Sep 17 00:00:00 2001 From: Kai Stevenson Date: Tue, 1 Sep 2026 19:08:17 -0700 Subject: lint --- src/sim/sim_manager/mod.rs | 5 ++--- src/sim/sim_manager/utils.rs | 8 ++++---- 2 files changed, 6 insertions(+), 7 deletions(-) (limited to 'src/sim/sim_manager') diff --git a/src/sim/sim_manager/mod.rs b/src/sim/sim_manager/mod.rs index ca68831..bbfd05e 100644 --- a/src/sim/sim_manager/mod.rs +++ b/src/sim/sim_manager/mod.rs @@ -174,13 +174,12 @@ impl SimManager { } } - if input_manager.pressed(Input::Action2) { - if let Some(entity_id) = written_entities_scope + if input_manager.pressed(Input::Action2) + && let Some(entity_id) = written_entities_scope .get_entity_id_at_position(input_manager.world_mouse_pos.round().as_ivec2()) { self.atomize_entity(entity_id); } - } // TEST ATOMIZATION diff --git a/src/sim/sim_manager/utils.rs b/src/sim/sim_manager/utils.rs index 45960bf..5bb7573 100644 --- a/src/sim/sim_manager/utils.rs +++ b/src/sim/sim_manager/utils.rs @@ -159,7 +159,7 @@ pub fn read_back_entities_from_world( let ec = entity.data.cells.as_mut().unwrap(); // first check if the entity has been partitioned let components = compute_components(&ec.cells, ec.size.x, ec.size.y); - if components.len() == 0 { + if components.is_empty() { sim.destroy_entity(entity_id); } else if components.len() == 1 { // the entity's cells were changed, but not partitioned @@ -193,9 +193,9 @@ pub fn read_back_entities_from_world( .get(entity.data.rb_h.unwrap()) // correctness -- not correct! because we don't have pos without rb .unwrap(); - let old_pose = old_rb.position().clone(); - let old_linvel = old_rb.linvel().clone(); - let old_angvel = old_rb.angvel().clone(); + let old_pose = *old_rb.position(); + let old_linvel = old_rb.linvel(); + let old_angvel = old_rb.angvel(); sim.destroy_entity(entity_id); -- cgit v1.3.1