bevy/crates
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
..
bevy_animation
bevy_app
bevy_asset
bevy_audio
bevy_core
bevy_core_pipeline
bevy_derive
bevy_diagnostic
bevy_dylib
bevy_dynamic_plugin
bevy_ecs Borrow instead of consuming in EventReader::clear (#6851) 2022-12-05 23:07:20 +00:00
bevy_ecs_compile_fail_tests
bevy_encase_derive
bevy_gilrs
bevy_gltf
bevy_hierarchy
bevy_input
bevy_internal
bevy_log
bevy_macro_utils
bevy_math Improve code/comments for Ray::intersect_plane and its tests (#6823) 2022-12-05 22:49:06 +00:00
bevy_mikktspace
bevy_pbr
bevy_ptr
bevy_reflect
bevy_render
bevy_scene
bevy_sprite
bevy_tasks
bevy_text
bevy_time
bevy_transform
bevy_ui
bevy_utils
bevy_window
bevy_winit