diff options
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) } |