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

Missing for-each Mut<T> indication for for-each Systems #44

Closed
carrascomj opened this issue Oct 8, 2020 · 2 comments
Closed

Missing for-each Mut<T> indication for for-each Systems #44

carrascomj opened this issue Oct 8, 2020 · 2 comments

Comments

@carrascomj
Copy link

Hello!

I started playing around with bevy (super cool) and it was quite exasperating to be unable to make for-each system with mutable components. Most of the frustration comes from the compiler giving useless feedback about not being able to build a system from the function. Also, most of the examples used query systems for these cases, so it was hard to find.

After converting everything to a query, I stumbled upon this in the Bevy-Cheatsheet:

You must use Mut instead of &mut T.

It would be cool if you could mention it in the book. I tried to look for it but I could not find it or, maybe, this pattern is discouraged, but it would also be worth mentioning it.

@cart
Copy link
Member

cart commented Oct 8, 2020

Yeah the book is pretty lacking in a number of places, but Mut<T> is a pretty major omission that a lot of people slip up on. I'm delaying Book work while we stabilize things, but slipping Mut<T> in there now seems like the right call.

@carrascomj
Copy link
Author

We can agree that this can be safely closed :) (bevyengine/bevy#798)

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

No branches or pull requests

2 participants