bevy/crates/bevy_ecs/src/schedule
Ben Frankel ee88d79d88
Simplify run conditions (#14441)
# Objective

Simplify Bevy-provided functions that return a condition-satisfying
closure instead of just being the condition.

## Solution

Become the condition.

## Testing

I did not test. Game jamming. Hopefully CI passes.

---

## Migration Guide

Some run conditions have been simplified.

```rust
// Before:
app.add_systems(Update, (
    system_0.run_if(run_once()),
    system_1.run_if(resource_changed_or_removed::<T>()),
    system_2.run_if(resource_removed::<T>()),
    system_3.run_if(on_event::<T>()),
    system_4.run_if(any_component_removed::<T>()),
));

// After:
app.add_systems(Update, (
    system_0.run_if(run_once),
    system_1.run_if(resource_changed_or_removed::<T>),
    system_2.run_if(resource_removed::<T>),
    system_3.run_if(on_event::<T>),
    system_4.run_if(any_component_removed::<T>),
));
```
2024-07-22 19:21:47 +00:00
..
executor multi_threaded feature rename (#12997) 2024-05-06 20:49:32 +00:00
condition.rs Simplify run conditions (#14441) 2024-07-22 19:21:47 +00:00
config.rs IntoSystemConfigs::chain_ignore_deferred's return type fix (#13919) 2024-06-18 22:21:58 +00:00
graph_utils.rs Use a unstable sort to sort component ids in bevy_ecs (#13789) 2024-06-17 14:56:19 +00:00
mod.rs Separate state crate (#13216) 2024-05-09 18:06:05 +00:00
schedule.rs multi_threaded feature rename (#12997) 2024-05-06 20:49:32 +00:00
set.rs Add on_unimplemented Diagnostics to Most Public Traits (#13347) (#13662) 2024-06-04 00:31:34 +00:00
stepping.rs Fix beta lints (#12980) 2024-04-16 02:46:46 +00:00