World::inspect_entity should return an iterator, not Vec #13933
Labels
A-ECS
Entities, components, systems, and events
C-Code-Quality
A section of code that is hard to understand or change
C-Usability
A targeted quality-of-life change that makes Bevy easier to use
D-Straightforward
Simple bug fixes and API improvements, docs, test and examples
X-Uncontroversial
This work is generally agreed upon
What problem does this solve or what need does it fill?
It's pretty uncommon for us to return
Vec
s in the API, and Iterators are generally more useful (since you can just collect them into a Vec immediately anyways). The current code even converts it from an iterator at the end:bevy/crates/bevy_ecs/src/world/mod.rs
Lines 498 to 502 in e34ecf2
What solution would you like?
Make
World::inspect_entity
return animpl Iterator<Item=&ComponentInfo>
instead of aVec<&ComponentInfo>
.The text was updated successfully, but these errors were encountered: