From 6b41d3ccef1ff4f56ab28974a74e5a3a664105bb Mon Sep 17 00:00:00 2001 From: HampusM Date: Sun, 12 May 2024 18:33:49 +0200 Subject: fix(ecs): add sole type name to sole not found panic message --- ecs/src/sole.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ecs/src/sole.rs b/ecs/src/sole.rs index fcff8de..e84e2a9 100644 --- a/ecs/src/sole.rs +++ b/ecs/src/sole.rs @@ -108,10 +108,9 @@ where world_data: &'world WorldData, ) -> Self { - let sole = world_data - .sole_storage - .get::() - .expect("Sole was not found in world"); + let sole = world_data.sole_storage.get::().unwrap_or_else(|| { + panic!("Sole {} was not found in world", type_name::()) + }); Self::new(sole) } -- cgit v1.2.3-18-g5258