Repository: bevyengine/bevy
File: crates/bevy_ecs/src/system/commands/mod.rs (Rust)

Code before:
    ///
    /// If that's not an option, consider [`Commands::register_system`] instead.
    pub fn run_system_cached_with<I, M, S>(&mut self, system: S, input: I::Inner<'static>)
    where
        I: SystemInput<Inner<'static>: Send> + Send + 'static,
        M: 'static,
        S: IntoSystem<I, (), M> + Send + 'static,
    {
        self.queue(command::run_system_cached_with(system, input).handle_error_with(warn));
    }

    /// Sends a global [`Event`] without any targets.
    ///
    /// This will run any [`Observer`] of the given [`Event`] that isn't scoped to specific targets.
    #[track_caller]
    pub fn trigger(&mut self, event: impl Event) {
        self.queue(command::trigger(event));
    }

    /// Sends an [`EntityEvent`] for the given targets.
    ///
    /// This will run any [`Observer`] of the given [`EntityEvent`] watching those targets.
    ///
    /// If the entity that this command targets does not exist when the command is applied,
    /// the command will fail, possibly causing it to panic based on the default error handler set.
    /// To queue this command with a handler, use [`EntityCommands::queue_handled`]
    /// with [`entity_command::trigger(event)`](entity_command::trigger).
    /// [`EntityCommands::queue_silenced`] may also be used to ignore the error completely.
    #[track_caller]
    pub fn trigger_targets(
        &mut self,
        event: impl EntityEvent,
        targets: impl TriggerTargets + Send + Sync + 'static,
    ) {
        self.queue(command::trigger_targets(event, targets));
    }

    /// Spawns an [`Observer`] and returns the [`EntityCommands`] associated
    /// with the entity that stores the observer.
    ///
    /// `observer` can be any system whose first parameter is [`On`].
    ///
    /// **Calling [`observe`](EntityCommands::observe) on the returned
    /// [`EntityCommands`] will observe the observer itself, which you very
    /// likely do not want.**
    ///
    /// # Panics
    ///
    /// Panics if the given system is an exclusive system.
    ///
    /// [`On`]: crate::observer::On

Review comment (suggestion):
Nit: `queue` still queues with a handler, just not one you can specify per command :P

```suggestion
    /// To queue this command with a specific handler, use [`EntityCommands::queue_handled`]
```

Code after:
    ///
    /// If that's not an option, consider [`Commands::register_system`] instead.
    pub fn run_system_cached_with<I, M, S>(&mut self, system: S, input: I::Inner<'static>)
    where
        I: SystemInput<Inner<'static>: Send> + Send + 'static,
        M: 'static,
        S: IntoSystem<I, (), M> + Send + 'static,
    {
        self.queue(command::run_system_cached_with(system, input).handle_error_with(warn));
    }

    /// Sends a global [`Event`] without any targets.
    ///
    /// This will run any [`Observer`] of the given [`Event`] that isn't scoped to specific targets.
    ///
    /// If the entity that this command targets does not exist when the command is applied,
    /// the command will fail, possibly causing it to panic based on the default [error handler](crate::error) set.
    ///
    /// To queue this command with a specific handler, use [`EntityCommands::queue_handled`]
    /// with [`entity_command::trigger(event)`](entity_command::trigger).
    /// [`EntityCommands::queue_silenced`] may also be used to ignore the error completely.
    #[track_caller]
    pub fn trigger(&mut self, event: impl Event) {
        self.queue(command::trigger(event));
    }

    /// Sends an [`EntityEvent`] for the given targets.
    ///
    /// This will run any [`Observer`] of the given [`EntityEvent`] watching those targets.
    ///
    /// If the entity that this command targets does not exist when the command is applied,
    /// the command will fail, possibly causing it to panic based on the default [error handler](crate::error) set.
    ///
    /// To queue this command with a specific handler, use [`EntityCommands::queue_handled`]
    /// with [`entity_command::trigger(event)`](entity_command::trigger).
    /// [`EntityCommands::queue_silenced`] may also be used to ignore the error completely.
    #[track_caller]
    pub fn trigger_targets(
        &mut self,
        event: impl EntityEvent,
        targets: impl TriggerTargets + Send + Sync + 'static,
    ) {
        self.queue(command::trigger_targets(event, targets));
    }

    /// Spawns an [`Observer`] and returns the [`EntityCommands`] associated
    /// with the entity that stores the observer.
    ///
    /// `observer` can be any system whose first parameter is [`On`].
    ///
    /// **Calling [`observe`](EntityCommands::observe) on the returned