diff options
author | HampusM <hampus@hampusmat.com> | 2024-05-12 18:33:49 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2024-05-12 18:33:49 +0200 |
commit | 6b41d3ccef1ff4f56ab28974a74e5a3a664105bb (patch) | |
tree | b98e35fc117230d635f8c645b00b9bfd04826dd7 /ecs/src/sole.rs | |
parent | 52171baf9101ff63be33f756c4cfe1046dd2bf88 (diff) |
fix(ecs): add sole type name to sole not found panic message
Diffstat (limited to 'ecs/src/sole.rs')
-rw-r--r-- | ecs/src/sole.rs | 7 |
1 files 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::<SoleT>() - .expect("Sole was not found in world"); + let sole = world_data.sole_storage.get::<SoleT>().unwrap_or_else(|| { + panic!("Sole {} was not found in world", type_name::<SoleT>()) + }); Self::new(sole) } |