Skip to content

Implement iterator for entity generation #19144

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

ElliottjPierce
Copy link
Contributor

Objective

This is a followup to @bushrat011899's comment here. This creates an "idiomatic next method" for the generation.

Solution

Super simple impl.

Also clarified ordering behavior in the docs while I'm here.

Testing

This effects literally nothing.

@ElliottjPierce ElliottjPierce added D-Trivial Nice and easy! A great choice to get started with Bevy A-ECS Entities, components, systems, and events C-Usability A targeted quality-of-life change that makes Bevy easier to use S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels May 9, 2025
@Mathspy
Copy link
Contributor

Mathspy commented May 9, 2025

I would strongly suggest against implementing Iterator on any Copy type in Rust 😅 That's the cause of all the pain around Range types in standard library right now (they are not Copy because Copy behaves weird with Iterators) see: https://users.rust-lang.org/t/why-doesnt-range-t-copy-implement-copy/51224/2 and rust-lang/rfcs#2848

@ElliottjPierce
Copy link
Contributor Author

Wow. That makes sense actually. I'll close this then. If people feel strongly, we can re open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ECS Entities, components, systems, and events C-Usability A targeted quality-of-life change that makes Bevy easier to use D-Trivial Nice and easy! A great choice to get started with Bevy S-Needs-Review Needs reviewer attention (from anyone!) to move forward
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants