Skip to content
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

bevy_ecs: Add doc example for par_iter_mut (#11311) #11499

Merged
merged 4 commits into from
Jan 28, 2024

Conversation

lkolbly
Copy link
Contributor

@lkolbly lkolbly commented Jan 23, 2024

Objective

Fixes #11311

Solution

Adds an example to the documentation for par_iter_mut. I didn't add any examples to par_iter, because I couldn't think of a good example and I figure users can infer that par_iter and par_iter_mut are similar.

@alice-i-cecile alice-i-cecile added C-Docs An addition or correction to our documentation A-ECS Entities, components, systems, and events labels Jan 24, 2024
Copy link
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really solid, thanks :)

Copy link
Contributor

@hymm hymm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to have this on Query::par_iter_mut, but that could be a follow up pr.

@alice-i-cecile alice-i-cecile added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Jan 27, 2024
@alice-i-cecile
Copy link
Member

Waiting until Monday: add the docs there too if you get a chance. Otherwise I'll make a follow-up issue.

@lkolbly
Copy link
Contributor Author

lkolbly commented Jan 27, 2024

Would be nice to have this on Query::par_iter_mut, but that could be a follow up pr.

Is that a different Query than the one in crates/bevy_ecs/src/system/query.rs?

@hymm
Copy link
Contributor

hymm commented Jan 27, 2024

Is that a different Query than the one in crates/bevy_ecs/src/system/query.rs?

Oops, not sure what I was thinking with that comment. Might have been to add them to par_iter instead and was thinking about something else at the same time.

@lkolbly
Copy link
Contributor Author

lkolbly commented Jan 27, 2024

Fair 'nuff. I can't think of any good examples for a succinct par_iter use case, they all involve atomics or locks or channels or some sort of synchronization. But, I added a note:

    /// Note that you must use the `for_each` method to iterate over the
    /// results, see [`par_iter_mut`] for an example.

which hopefully should point users in the right direction?

@alice-i-cecile alice-i-cecile added this pull request to the merge queue Jan 28, 2024
Merged via the queue into bevyengine:main with commit 9fcf862 Jan 28, 2024
22 checks passed
tjamaan pushed a commit to tjamaan/bevy that referenced this pull request Feb 6, 2024
…gine#11499)

# Objective

Fixes bevyengine#11311 

## Solution

Adds an example to the documentation for `par_iter_mut`. I didn't add
any examples to `par_iter`, because I couldn't think of a good example
and I figure users can infer that `par_iter` and `par_iter_mut` are
similar.
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-Docs An addition or correction to our documentation S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing docs in Query::par_iter and Query::par_iter_mut
3 participants