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

Implement Deref and DerefMut for In #11104

Merged
merged 2 commits into from
Jan 1, 2024

Conversation

Adamkob12
Copy link
Contributor

Objective

Implement Deref and DerefMut for In

makes it so the user doesn't have to add ".0" in most cases

@matiqo15 matiqo15 added A-ECS Entities, components, systems, and events C-Usability A targeted quality-of-life change that makes Bevy easier to use labels Dec 27, 2023
Copy link
Contributor

@ItsDoot ItsDoot left a comment

Choose a reason for hiding this comment

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

LGTM. I do want to point out that you can also use a destructuring pattern as-is:

pub fn my_system(In(foo): In<Foo>) {
    // ...
}

@matiqo15 matiqo15 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 Dec 27, 2023
@Adamkob12
Copy link
Contributor Author

Adamkob12 commented Dec 27, 2023

LGTM. I do want to point out that you can also use a destructuring pattern as-is:

pub fn my_system(In(foo): In<Foo>) {
    // ...
}

99% that would be the case, but im working on a plugin with a type alias similar to:
type MyType = In<SmthPrivate>;
And I want the user to use MyType as a system param, etc.
in this case the user won't be able to deconstruct using In(x) = ..

@alice-i-cecile alice-i-cecile added this pull request to the merge queue Jan 1, 2024
Merged via the queue into bevyengine:main with commit 8baefa1 Jan 1, 2024
26 checks passed
@Adamkob12 Adamkob12 deleted the impl_deref_for_in branch January 3, 2024 14:53
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 targeted 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.

4 participants