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

feat: Add world.with_or_insert_component_mut() #223

Merged
merged 2 commits into from
Jan 22, 2025

Conversation

shanecelis
Copy link
Contributor

Just a convenience method I found useful.

I removed some panic comments on the with_component_*() because I don't believe they panic, but I didn't affirm that with tests.

Accepts Option<&T>. Should not panic if component is not available.
@makspll
Copy link
Owner

makspll commented Jan 22, 2025

Looks good! The only thing I'd say is the function could be slightly more lenient in terms of claiming access when the component does exist (in which case it could just claim access to it) but I am not too bothered atm and that could be changed later

@makspll makspll changed the title Add world.with_or_insert_component_mut() feat: Add world.with_or_insert_component_mut() Jan 22, 2025
@makspll makspll merged commit b2c39d0 into makspll:staging Jan 22, 2025
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants