Skip to content

Commit

Permalink
Fixed panic messages
Browse files Browse the repository at this point in the history
  • Loading branch information
kabergstrom committed Jan 22, 2022
1 parent c8cd12d commit 3fea380
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ergo/scope.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ impl<'a> ErgoScope<'a> {
unsafe {
components.put(|src_ptr, type_info| {
if self.access.has_active_borrows(entity, type_info.id()) {
panic!("Component {:?} on entity {:?} has an active borrow when inserting component", entity, type_info.id());
panic!("Component {} on entity {:?} has an active borrow when inserting component", type_info.name().unwrap_or(""), entity);
}
if let Some(new_ptr) = data.put_component(type_info, src_ptr) {
self.access.update_data_ptr(entity, &type_info, new_ptr);
Expand All @@ -126,7 +126,7 @@ impl<'a> ErgoScope<'a> {
unsafe {
components.put(|ptr, ty| {
if self.access.has_active_borrows(entity, ty.id()) {
panic!("Component {:?} on entity {:?} has an active borrow when inserting component", entity, ty.id());
panic!("Component {} on entity {:?} has an active borrow when inserting component", ty.name().unwrap_or(""), entity);
}
if let Some(new_ptr) = override_data.put_component(ty, ptr) {
self.access.update_data_ptr(entity, &ty, new_ptr);
Expand Down Expand Up @@ -172,7 +172,7 @@ impl<'a> ErgoScope<'a> {
let removed_data = T::get(|ty| existing_data.get_data_ptr(ty.id()))?;
for ty in T::static_type_info() {
if self.access.has_active_borrows(entity, ty.id()) {
panic!("Component {:?} on entity {:?} has an active borrow when removing component", entity, ty.id());
panic!("Component {} on entity {:?} has an active borrow when removing component", ty.name().unwrap_or(""), entity);
}
if existing_data.remove_assume_moved(ty.id()) {
self.access.update_data_ptr(entity, &ty, null_mut());
Expand Down Expand Up @@ -203,7 +203,7 @@ impl<'a> ErgoScope<'a> {
EntityOverride::Changed(data) => unsafe {
for ty in &data.types {
if self.access.has_active_borrows(entity, ty.id()) {
panic!("Component {:?} on entity {:?} has an active borrow when despawning entity", entity, ty.id());
panic!("Component {} on entity {:?} has an active borrow when despawning entity", ty.name().unwrap_or(""), entity);
}
self.access.update_data_ptr(entity, &ty, null_mut());
}
Expand Down

0 comments on commit 3fea380

Please sign in to comment.