Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Borrow instead of consuming in
EventReader::clear
(bevyengine#6851)
The PR fixes the interface of `EventReader::clear`. Currently, the method consumes the reader, which makes it unusable. ## Changelog - `EventReader::clear` now takes a mutable reference instead of consuming the event reader. ## Migration Guide `EventReader::clear` now takes a mutable reference instead of consuming the event reader. This means that `clear` now needs explicit mutable access to the reader variable, which previously could have been omitted in some cases: ```rust // Old (0.9) fn clear_events(reader: EventReader<SomeEvent>) { reader.clear(); } // New (0.10) fn clear_events(mut reader: EventReader<SomeEvent>) { reader.clear(); } ``` Co-authored-by: Carter Anderson <[email protected]>
- Loading branch information