Skip to content

Commit efd9d22

Browse files
TurtIeSocksmockersf
authored andcommitted
Remove unused debug identifiers for ComponentHooks methods (#16228)
# Objective - Cleans up unused debug identifiers for `ComponentHooks` methods: `on_add`, `on_insert`, `on_replace`, and `on_remove` ## Solution - Simplify the expect messages by removing the unused `{:?}` ## Testing - Currently untested [Context](https://discord.com/channels/691052431525675048/749335865876021248/1302988180592525362)
1 parent f10e9bc commit efd9d22

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

crates/bevy_ecs/src/component.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ impl ComponentHooks {
487487
/// Will panic if the component already has an `on_add` hook
488488
pub fn on_add(&mut self, hook: ComponentHook) -> &mut Self {
489489
self.try_on_add(hook)
490-
.expect("Component id: {:?}, already has an on_add hook")
490+
.expect("Component already has an on_add hook")
491491
}
492492

493493
/// Register a [`ComponentHook`] that will be run when this component is added (with `.insert`)
@@ -505,7 +505,7 @@ impl ComponentHooks {
505505
/// Will panic if the component already has an `on_insert` hook
506506
pub fn on_insert(&mut self, hook: ComponentHook) -> &mut Self {
507507
self.try_on_insert(hook)
508-
.expect("Component id: {:?}, already has an on_insert hook")
508+
.expect("Component already has an on_insert hook")
509509
}
510510

511511
/// Register a [`ComponentHook`] that will be run when this component is about to be dropped,
@@ -527,7 +527,7 @@ impl ComponentHooks {
527527
/// Will panic if the component already has an `on_replace` hook
528528
pub fn on_replace(&mut self, hook: ComponentHook) -> &mut Self {
529529
self.try_on_replace(hook)
530-
.expect("Component id: {:?}, already has an on_replace hook")
530+
.expect("Component already has an on_replace hook")
531531
}
532532

533533
/// Register a [`ComponentHook`] that will be run when this component is removed from an entity.
@@ -538,7 +538,7 @@ impl ComponentHooks {
538538
/// Will panic if the component already has an `on_remove` hook
539539
pub fn on_remove(&mut self, hook: ComponentHook) -> &mut Self {
540540
self.try_on_remove(hook)
541-
.expect("Component id: {:?}, already has an on_remove hook")
541+
.expect("Component already has an on_remove hook")
542542
}
543543

544544
/// Attempt to register a [`ComponentHook`] that will be run when this component is added to an entity.

0 commit comments

Comments
 (0)