From 83b602a77c10f9212984cdd00fc1cc7d7955a677 Mon Sep 17 00:00:00 2001 From: JoJoJet <21144246+JoJoJet@users.noreply.github.com> Date: Sun, 25 Dec 2022 00:51:14 +0000 Subject: [PATCH] Relax `Sync` bound on anonymous `Command`s (#7014) # Objective Any closure with the signature `FnOnce(&mut World)` implicitly implements the trait `Command` due to a blanket implementation. However, this implementation unnecessarily has the `Sync` bound, which limits the types that can be used. ## Solution Remove the bound. --- ## Changelog - `Command` closures no longer need to implement the marker trait `std::marker::Sync`. --- crates/bevy_ecs/src/system/commands/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bevy_ecs/src/system/commands/mod.rs b/crates/bevy_ecs/src/system/commands/mod.rs index e89d365948..7fede918fd 100644 --- a/crates/bevy_ecs/src/system/commands/mod.rs +++ b/crates/bevy_ecs/src/system/commands/mod.rs @@ -709,7 +709,7 @@ impl<'w, 's, 'a> EntityCommands<'w, 's, 'a> { impl Command for F where - F: FnOnce(&mut World) + Send + Sync + 'static, + F: FnOnce(&mut World) + Send + 'static, { fn write(self, world: &mut World) { self(world);