[Merged by Bors] - Rework manual event iterator so we can actually name the type#5735
[Merged by Bors] - Rework manual event iterator so we can actually name the type#5735Aceeri wants to merge 13 commits intobevyengine:mainfrom
Conversation
ed9c4a4 to
df18953
Compare
joseph-gio
left a comment
There was a problem hiding this comment.
Everything here looks good to me.
In the future, I think we should consider renaming .iter(). It always feels wrong and surprising that events.iter() mutates events, and it's especially surprising that for _ in &events does not work. Borrowing from std::io::Read, I think a potentially better name for that method would be .read().
|
I think it somewhat makes sense in that events is basically a saved iterator, we aren't actually mutating |
|
Mutating |
alice-i-cecile
left a comment
There was a problem hiding this comment.
Can you add the little utility methods (get_events and friends) to the change log too? They're quite useful, but easy to overlook.
bors r+
# Objective - Be able to name the type that `ManualEventReader::iter/iter_with_id` returns and `EventReader::iter/iter_with_id` by proxy. Currently for the purpose of #5719 ## Solution - Create a custom `Iterator` type.
|
Build failed (retrying...): |
# Objective - Be able to name the type that `ManualEventReader::iter/iter_with_id` returns and `EventReader::iter/iter_with_id` by proxy. Currently for the purpose of #5719 ## Solution - Create a custom `Iterator` type.
|
Build failed (retrying...): |
# Objective - Be able to name the type that `ManualEventReader::iter/iter_with_id` returns and `EventReader::iter/iter_with_id` by proxy. Currently for the purpose of #5719 ## Solution - Create a custom `Iterator` type.
…gine#5735) # Objective - Be able to name the type that `ManualEventReader::iter/iter_with_id` returns and `EventReader::iter/iter_with_id` by proxy. Currently for the purpose of bevyengine#5719 ## Solution - Create a custom `Iterator` type.
…gine#5735) # Objective - Be able to name the type that `ManualEventReader::iter/iter_with_id` returns and `EventReader::iter/iter_with_id` by proxy. Currently for the purpose of bevyengine#5719 ## Solution - Create a custom `Iterator` type.
Objective
ManualEventReader::iter/iter_with_idreturns andEventReader::iter/iter_with_idby proxy.Currently for the purpose of Add
IntoIteratorto &mut EventReader #5719Solution
Iteratortype.Changelog
oldest_idandget_eventconvenience methods added toEvents<T>.