[Merged by Bors] - Use a default implementation for set_if_neq#7660
Closed
joseph-gio wants to merge 8 commits intobevyengine:mainfrom
Closed
[Merged by Bors] - Use a default implementation for set_if_neq#7660joseph-gio wants to merge 8 commits intobevyengine:mainfrom
set_if_neq#7660joseph-gio wants to merge 8 commits intobevyengine:mainfrom
Conversation
set_if_neq
alice-i-cecile
approved these changes
Feb 15, 2023
james7132
approved these changes
Feb 15, 2023
Member
|
bors r+ |
bors bot
pushed a commit
that referenced
this pull request
Feb 15, 2023
# Objective While porting my crate `bevy_trait_query` to bevy 0.10, I ran into an issue with the `DetectChangesMut` trait. Due to the way that the `set_if_neq` method (added in #6853) is implemented, you are forced to write a nonsense implementation of it for dynamically sized types. This edge case shows up when implementing trait queries, since `DetectChangesMut` is implemented for `Mut<dyn Trait>`. ## Solution Simplify the generics for `set_if_neq` and add the `where Self::Target: Sized` trait bound to it. Add a default implementation so implementers don't need to implement a method with nonsensical trait bounds.
Contributor
set_if_neqset_if_neq
myreprise1
pushed a commit
to myreprise1/bevy
that referenced
this pull request
Feb 16, 2023
# Objective While porting my crate `bevy_trait_query` to bevy 0.10, I ran into an issue with the `DetectChangesMut` trait. Due to the way that the `set_if_neq` method (added in bevyengine#6853) is implemented, you are forced to write a nonsense implementation of it for dynamically sized types. This edge case shows up when implementing trait queries, since `DetectChangesMut` is implemented for `Mut<dyn Trait>`. ## Solution Simplify the generics for `set_if_neq` and add the `where Self::Target: Sized` trait bound to it. Add a default implementation so implementers don't need to implement a method with nonsensical trait bounds.
myreprise1
pushed a commit
to myreprise1/bevy
that referenced
this pull request
Feb 16, 2023
# Objective While porting my crate `bevy_trait_query` to bevy 0.10, I ran into an issue with the `DetectChangesMut` trait. Due to the way that the `set_if_neq` method (added in bevyengine#6853) is implemented, you are forced to write a nonsense implementation of it for dynamically sized types. This edge case shows up when implementing trait queries, since `DetectChangesMut` is implemented for `Mut<dyn Trait>`. ## Solution Simplify the generics for `set_if_neq` and add the `where Self::Target: Sized` trait bound to it. Add a default implementation so implementers don't need to implement a method with nonsensical trait bounds.
joseph-gio
added a commit
to joseph-gio/bevy-trait-query
that referenced
this pull request
Feb 16, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Objective
While porting my crate
bevy_trait_queryto bevy 0.10, I ran into an issue with theDetectChangesMuttrait. Due to the way that theset_if_neqmethod (added in #6853) is implemented, you are forced to write a nonsense implementation of it for dynamically sized types. This edge case shows up when implementing trait queries, sinceDetectChangesMutis implemented forMut<dyn Trait>.Solution
Simplify the generics for
set_if_neqand add thewhere Self::Target: Sizedtrait bound to it. Add a default implementation so implementers don't need to implement a method with nonsensical trait bounds.