Skip to content

Commit

Permalink
Relax Sync bound on anonymous Commands (bevyengine#7014)
Browse files Browse the repository at this point in the history
# 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`.
  • Loading branch information
JoJoJet authored and alradish committed Jan 22, 2023
1 parent 0ca7882 commit b8e3b03
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/bevy_ecs/src/system/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ impl<'w, 's, 'a> EntityCommands<'w, 's, 'a> {

impl<F> 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);
Expand Down

0 comments on commit b8e3b03

Please sign in to comment.