You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Smart pointers often come in two forms. In bevy's case, the most common are typically Res and ResMut.
Users should only use this when necessary (i.e. when they actually intend to mutate the data), and should request the less powerful (more easily parallelized) immutable variant when they can.
As a result, using requesting a ResMut without actually making it mutable is almost always a mistake.
Example code
fnmy_system(time:ResMut<Time>){}
Should be
fnmy_system(time:Res<Time>){}
Notes
False positives may exist, e.g. with interior mutability, so advanced users need a way to locally allow this.
The text was updated successfully, but these errors were encountered:
Lint explanation
Smart pointers often come in two forms. In bevy's case, the most common are typically
Res
andResMut
.Users should only use this when necessary (i.e. when they actually intend to mutate the data), and should request the less powerful (more easily parallelized) immutable variant when they can.
As a result, using requesting a
ResMut
without actually making it mutable is almost always a mistake.Example code
Should be
Notes
False positives may exist, e.g. with interior mutability, so advanced users need a way to locally allow this.
The text was updated successfully, but these errors were encountered: