Skip to content

Commit

Permalink
fix example
Browse files Browse the repository at this point in the history
  • Loading branch information
SpecificProtagonist committed Dec 12, 2024
1 parent 6245c93 commit ce81b1a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions examples/ecs/component_hooks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ fn setup(world: &mut World) {
let value = world.get::<MyComponent>(entity).unwrap().0;
println!(
"{component_id:?} added to {entity:?} with value {value:?}{}",
caller.map(|location| format!("due to {location}").unwrap_or_default())
caller
.map(|location| format!("due to {location}"))
.unwrap_or_default()
);
// Or access resources
world
Expand All @@ -102,7 +104,9 @@ fn setup(world: &mut World) {
let value = world.get::<MyComponent>(entity).unwrap().0;
println!(
"{component_id:?} removed from {entity:?} with value {value:?}{}",
caller.map(|location| format!("due to {location}").unwrap_or_default())
caller
.map(|location| format!("due to {location}"))
.unwrap_or_default()
);
// You can also issue commands through `.commands()`
world.commands().entity(entity).despawn();
Expand Down

0 comments on commit ce81b1a

Please sign in to comment.