Skip to content

Commit ce81b1a

Browse files
fix example
1 parent 6245c93 commit ce81b1a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

examples/ecs/component_hooks.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ fn setup(world: &mut World) {
7575
let value = world.get::<MyComponent>(entity).unwrap().0;
7676
println!(
7777
"{component_id:?} added to {entity:?} with value {value:?}{}",
78-
caller.map(|location| format!("due to {location}").unwrap_or_default())
78+
caller
79+
.map(|location| format!("due to {location}"))
80+
.unwrap_or_default()
7981
);
8082
// Or access resources
8183
world
@@ -102,7 +104,9 @@ fn setup(world: &mut World) {
102104
let value = world.get::<MyComponent>(entity).unwrap().0;
103105
println!(
104106
"{component_id:?} removed from {entity:?} with value {value:?}{}",
105-
caller.map(|location| format!("due to {location}").unwrap_or_default())
107+
caller
108+
.map(|location| format!("due to {location}"))
109+
.unwrap_or_default()
106110
);
107111
// You can also issue commands through `.commands()`
108112
world.commands().entity(entity).despawn();

0 commit comments

Comments
 (0)