diff options
author | HampusM <hampus@hampusmat.com> | 2025-03-18 13:21:46 +0100 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2025-03-18 13:21:46 +0100 |
commit | 7a7d3a350b22b5555c27debff6fee4fc6100fa38 (patch) | |
tree | 9eb96f2563264f51691e2a06a7b95f8b39904d18 /ecs/src/component/storage.rs | |
parent | ee7c0cb713891ae480407f56823289f3fe3b9807 (diff) |
Diffstat (limited to 'ecs/src/component/storage.rs')
-rw-r--r-- | ecs/src/component/storage.rs | 14 |
1 files changed, 7 insertions, 7 deletions
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::<Vec<_>>(), @@ -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 }, |