bevy/examples/games
Vladyslav Batyrenko b337ed63ad Borrow instead of consuming in EventReader::clear (#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 <mcanders1@gmail.com>
2022-12-05 23:07:20 +00:00
..
alien_cake_addict.rs Remove auto-margin properties from the examples (#6535) 2022-11-21 14:38:35 +00:00
breakout.rs Borrow instead of consuming in EventReader::clear (#6851) 2022-12-05 23:07:20 +00:00
contributors.rs Don't kill contributors on window squish (#6675) 2022-11-18 11:24:07 +00:00
game_menu.rs Remove auto-margin properties from the examples (#6535) 2022-11-21 14:38:35 +00:00