-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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 std derives to SystemParam types #16785
base: main
Are you sure you want to change the base?
Add std derives to SystemParam types #16785
Conversation
@@ -400,6 +401,7 @@ unsafe impl<P: SystemParam, B: SystemParamBuilder<P>> SystemParamBuilder<Vec<P>> | |||
/// set.for_each(|mut query| for mut health in query.iter_mut() {}); | |||
/// } | |||
/// ``` | |||
#[derive(Debug, Default, Copy, Clone)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why Copy
here?
It would be helpful to reviewers to briefly explain why |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with the code changes themselves, but some justification would be appreciated! :)
If it were just Clone, that would be easier to approve. Why Copy? |
Sorry for the delay replying. Types should eagerly implement applicable traits. My use case was playing around with some dynamic manipulation of builders in order to inject data into a system during state initialization, and my test usage with So I think the question is better asked as: why not? Builder types are only used in the guts of As for Note that for actual |
More derives mean more build time
A lot of people think this advice is wrong. Deriving |
Objective
Clone
onSystemParam
, when applicable, in a generic context.Solution
Testing
cargo test
once.