From 8af5413b0fd2b06f71098c1230f79b3e6beb037d Mon Sep 17 00:00:00 2001 From: HampusM Date: Fri, 24 May 2024 19:15:23 +0200 Subject: feat(ecs): add component name to component locking panic message --- ecs/src/lib.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'ecs/src/lib.rs') diff --git a/ecs/src/lib.rs b/ecs/src/lib.rs index fbcc451..0bc7aa6 100644 --- a/ecs/src/lib.rs +++ b/ecs/src/lib.rs @@ -48,6 +48,7 @@ struct Entity pub struct EntityComponent { pub id: TypeId, + pub name: &'static str, pub component: Lock>, pub drop_last: bool, } @@ -90,6 +91,7 @@ impl World ManuallyDrop::new(EntityComponent { id: (*component).type_id(), + name: component.type_name(), component: Lock::new(component), drop_last, }) @@ -187,6 +189,7 @@ impl World ManuallyDrop::new(EntityComponent { id: (*component).type_id(), + name: component.type_name(), component: Lock::new(component), drop_last, }) -- cgit v1.2.3-18-g5258