-
Notifications
You must be signed in to change notification settings - Fork 222
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 more Debug/Copy trait impls #377
Conversation
src/config.rs
Outdated
@@ -24,7 +24,7 @@ impl RecursiveMode { | |||
/// Runtime configuration items for watchers. | |||
/// | |||
/// See the [`Watcher::configure`](../trait.Watcher.html#tymethod.configure) method for usage. | |||
#[derive(Clone, Debug, PartialEq, Eq)] | |||
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] |
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 do you need Hash ?
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 don't see why everything has to be Hash and Copy, adding more compile time.
Copy makes everything unable to integrate anything that is clone, so any changes that require clone will be API breaking (especially config is such a candidate). And specifically for watchers it is not advised to implement Clone/Copy.
Also please don't format stuff unrelated to your PR, this makes it much harder to review.
By making your types implement common traits (that make sense), it's easier to use the library. Due to orphan rules, it would be impossible for a consumer of the library to put the type in a Also, the difference compile-time is so small it's difficult to measure.
I'll restrict the Also, it's already a breaking change to change variants of a public enum or to add variants to a non-
I'll remove the watcher Clone/Copy.
Sure--I kept them in separate commits, but I'll drop them.
|
This makes it easier to derive traits when they contain a notify type.
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'd remove the debug traits on internal stuff. The changelog addition is nice, though we haven't updated that in a longer time. I'm still fetching all changes manually per release and the "overall" thing will have to be regenerated anyway ;)
True, which is a reason we should probably make the fields non-pub and use a "builder" pattern.
Yes and no. Not adding copy to bigger types prevents you from accidentally copying stuff instead when you'd probably rather use a reference. |
Thanks for your patience and the PR! When CI finished I'll merge it. |
Also adds other useful impls.