Skip to content

Commit 44e8dcb

Browse files
Added comments explaining need for tiny map functions
1 parent ac56e12 commit 44e8dcb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

crates/bevy_ecs/src/event.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,10 +252,14 @@ impl<T: Component> Events<T> {
252252
}
253253
}
254254

255+
// Needed to ensure match branches have same type signature
256+
// As closures never have the same type
255257
fn map_instance_event_with_id<T>(event_instance: &EventInstance<T>) -> (&T, EventId<T>) {
256258
(&event_instance.event, event_instance.event_id)
257259
}
258260

261+
// Needed to ensure match branches have same type signature
262+
// As closures never have the same type
259263
fn map_instance_event<T>(event_instance: &EventInstance<T>) -> &T {
260264
&event_instance.event
261265
}

0 commit comments

Comments
 (0)