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

Add a public constructor for Mut<T> #7931

Merged
merged 8 commits into from
Mar 9, 2023
Merged

Conversation

JoJoJet
Copy link
Member

@JoJoJet JoJoJet commented Mar 6, 2023

Objective

Fix #6497.

Since it is not possible to construct an instance of Mut<T> outside of bevy_ecs, other crates that need similar behavior (such as bevy-trait-query) need to create their own duplicate implementations of this type.

Solution

Add a public constructor for Mut<T>.


Changelog

  • Added the associated function new to Mut<T>.

@JoJoJet JoJoJet added C-Enhancement A new feature A-ECS Entities, components, systems, and events labels Mar 6, 2023
@alice-i-cecile alice-i-cecile added C-Usability A simple quality-of-life change that makes Bevy easier to use and removed C-Enhancement A new feature labels Mar 6, 2023
crates/bevy_ecs/src/query/fetch.rs Outdated Show resolved Hide resolved
@JoJoJet
Copy link
Member Author

JoJoJet commented Mar 8, 2023

Alright, I've removed the internal uses and added a test case.

Copy link
Contributor

@Carter0 Carter0 left a comment

Choose a reason for hiding this comment

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

LGTM

@james7132 james7132 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 Mar 9, 2023
@james7132 james7132 added this pull request to the merge queue Mar 9, 2023
Merged via the queue into bevyengine:main with commit 21ddc60 Mar 9, 2023
Shfty pushed a commit to shfty-rust/bevy that referenced this pull request Mar 19, 2023
Shfty pushed a commit to shfty-rust/bevy that referenced this pull request Mar 19, 2023
@JoJoJet JoJoJet deleted the mut-ctor branch April 5, 2023 14:22
JoJoJet added a commit to JoJoJet/bevy-trait-query that referenced this pull request Apr 5, 2023
Update the crate to bevy's main branch. Notably, this allows us to remove this crate's custom implementation of `Mut`, since the function `Mut::new` has been added upstream in bevyengine/bevy#7931.
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 simple quality-of-life change that makes Bevy easier to use 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.

Expose a public constructor for Mut
4 participants