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/storage.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'ecs/src/component/storage.rs') diff --git a/ecs/src/component/storage.rs b/ecs/src/component/storage.rs index b68f89d..f2306b7 100644 --- a/ecs/src/component/storage.rs +++ b/ecs/src/component/storage.rs @@ -161,7 +161,7 @@ impl Storage .archetype() .has_component_with_id(component.self_id()) { - return Err(Error::EntityAlreadyHasComponent { + return Err(Error::ComponentAlreadyInEntity { entity: entity_uid, component: component.self_id(), }); @@ -254,7 +254,7 @@ impl Storage .archetype() .has_component_with_id(component_id) { - return Err(Error::EntityDoesNotHaveComponent { + return Err(Error::ComponentNotFoundInEntity { entity: entity_uid, component: component_id, }); @@ -452,7 +452,7 @@ impl<'component_storage> Iterator for ArchetypeRefIter<'component_storage> self.dfs_iter.push(( BorrowedOrOwned::Owned(Archetype::new( add_edge_archetype_id, - &add_edge_archetype_comps + add_edge_archetype_comps .iter() .map(|metadata| metadata.id) .collect::>(), @@ -476,7 +476,7 @@ impl<'component_storage> Iterator for ArchetypeRefIter<'component_storage> } } -impl<'storage> ArchetypeRefIter<'storage> +impl ArchetypeRefIter<'_> { fn find_edges_of_imaginary_archetype( &self, @@ -484,7 +484,7 @@ impl<'storage> ArchetypeRefIter<'storage> ) -> Vec<(Uid, ArchetypeEdges)> { self.storage - .find_all_archetype_with_comps(&imaginary_archetype_comps) + .find_all_archetype_with_comps(imaginary_archetype_comps) .into_iter() .filter_map(|found_id| { let found_archetype = self.storage.get_archetype_by_id(found_id).unwrap(); @@ -531,13 +531,13 @@ pub enum Error EntityDoesNotExist(Uid), #[error("Entity with ID {entity:?} already has component with ID {component:?}")] - EntityAlreadyHasComponent + ComponentAlreadyInEntity { entity: Uid, component: Uid }, #[error("Entity with ID {entity:?} does not have component with ID {component:?}")] - EntityDoesNotHaveComponent + ComponentNotFoundInEntity { entity: Uid, component: Uid }, -- cgit v1.2.3-18-g5258