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)
This commit is contained in:
Derick M 2024-11-04 10:41:07 -05:00 committed by François
parent f10e9bce77
commit efd9d2215c
No known key found for this signature in database

View file

@ -487,7 +487,7 @@ impl ComponentHooks {
/// Will panic if the component already has an `on_add` hook
pub fn on_add(&mut self, hook: ComponentHook) -> &mut Self {
self.try_on_add(hook)
.expect("Component id: {:?}, already has an on_add hook")
.expect("Component already has an on_add hook")
}
/// Register a [`ComponentHook`] that will be run when this component is added (with `.insert`)
@ -505,7 +505,7 @@ impl ComponentHooks {
/// Will panic if the component already has an `on_insert` hook
pub fn on_insert(&mut self, hook: ComponentHook) -> &mut Self {
self.try_on_insert(hook)
.expect("Component id: {:?}, already has an on_insert hook")
.expect("Component already has an on_insert hook")
}
/// Register a [`ComponentHook`] that will be run when this component is about to be dropped,
@ -527,7 +527,7 @@ impl ComponentHooks {
/// Will panic if the component already has an `on_replace` hook
pub fn on_replace(&mut self, hook: ComponentHook) -> &mut Self {
self.try_on_replace(hook)
.expect("Component id: {:?}, already has an on_replace hook")
.expect("Component already has an on_replace hook")
}
/// Register a [`ComponentHook`] that will be run when this component is removed from an entity.
@ -538,7 +538,7 @@ impl ComponentHooks {
/// Will panic if the component already has an `on_remove` hook
pub fn on_remove(&mut self, hook: ComponentHook) -> &mut Self {
self.try_on_remove(hook)
.expect("Component id: {:?}, already has an on_remove hook")
.expect("Component already has an on_remove hook")
}
/// Attempt to register a [`ComponentHook`] that will be run when this component is added to an entity.