diff --git a/crates/bevy_ecs/src/observer/distributed_storage.rs b/crates/bevy_ecs/src/observer/distributed_storage.rs index 547b1d61ca..a7d3777bf5 100644 --- a/crates/bevy_ecs/src/observer/distributed_storage.rs +++ b/crates/bevy_ecs/src/observer/distributed_storage.rs @@ -291,7 +291,7 @@ impl Observer { /// # Safety /// The type of the `event_key` [`EventKey`] _must_ match the actual value /// of the event passed into the observer system. - pub unsafe fn with_event(mut self, event_key: EventKey) -> Self { + pub unsafe fn with_event_key(mut self, event_key: EventKey) -> Self { self.descriptor.event_keys.push(event_key); self } @@ -364,7 +364,7 @@ impl ObserverDescriptor { /// # Safety /// The type of each [`EventKey`] in `event_keys` _must_ match the actual value /// of the event passed into the observer. - pub unsafe fn with_events(mut self, event_keys: Vec) -> Self { + pub unsafe fn with_event_keys(mut self, event_keys: Vec) -> Self { self.event_keys = event_keys; self } diff --git a/crates/bevy_ecs/src/observer/mod.rs b/crates/bevy_ecs/src/observer/mod.rs index 1bbca5e763..12e7dd60e6 100644 --- a/crates/bevy_ecs/src/observer/mod.rs +++ b/crates/bevy_ecs/src/observer/mod.rs @@ -741,7 +741,7 @@ mod tests { Observer::new(|_: On, mut res: ResMut| { res.observed("add/remove"); }) - .with_event(on_remove) + .with_event_key(on_remove) }, ); @@ -1015,7 +1015,7 @@ mod tests { Observer::with_dynamic_runner(|mut world, _trigger, _ptr, _propagate| { world.resource_mut::().observed("event_a"); }) - .with_event(event_a) + .with_event_key(event_a) }; world.spawn(observe);