bevy/crates/bevy_ecs/macros/src
Christian Hughes 9c004439b8
Remove States::variants and remove enum-only restriction its derive (#9945)
# Objective

The `States::variants` method was once used to construct `OnExit` and
`OnEnter` schedules for every possible value of a given `States` type.
[Since the switch to lazily initialized
schedules](https://github.com/bevyengine/bevy/pull/8028/files#diff-b2fba3a0c86e496085ce7f0e3f1de5960cb754c7d215ed0f087aa556e529f97f),
we no longer need to track every possible value.

This also opens the door to `States` types that aren't enums.

## Solution

- Remove the unused `States::variants` method and its associated type.
- Remove the enum-only restriction on derived States types.

---

## Changelog

- Removed `States::variants` and its associated type.
- Derived `States` can now be datatypes other than enums.

## Migration Guide

- `States::variants` no longer exists. If you relied on this function,
consider using a library that provides enum iterators.
2023-09-30 22:32:39 +00:00
..
component.rs Fix typos throughout the project (#9090) 2023-07-10 00:11:51 +00:00
fetch.rs Fix CI for Rust 1.72 (#9562) 2023-08-25 12:34:24 +00:00
lib.rs Fix the clippy::explicit_iter_loop lint (#9834) 2023-09-19 03:35:22 +00:00
set.rs Schedule-First: the new and improved add_systems (#8079) 2023-03-18 01:45:34 +00:00
states.rs Remove States::variants and remove enum-only restriction its derive (#9945) 2023-09-30 22:32:39 +00:00