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

ModifyKind does not derive Copy #458

Closed
jasonheath opened this issue Dec 12, 2022 · 3 comments · Fixed by #481
Closed

ModifyKind does not derive Copy #458

jasonheath opened this issue Dec 12, 2022 · 3 comments · Fixed by #481

Comments

@jasonheath
Copy link

Apologies if I should ask this in a different place but I think the issues section is correct for this project. I've noticed that ModifyKind doesn't derive Copy. Based on a quick visual inspection I believe that all of its peer enums and the enums it makes use of derive Copy. Is there a reason it doesn't? If there isn't I can submit a pull request that derives copy.

@0xpr03
Copy link
Member

0xpr03 commented Dec 13, 2022

Yeah there is currently no real blocker for deriving copy on top of clone. But it also will make it impossible to remove, if for any reason we should want a bigger sub type / value later on. But I could be too restrictive in favor of unknown unknowns.

Is there a good use case for making it copy ?

@dfaust
Copy link
Member

dfaust commented Apr 24, 2023

Is there a good use case for making it copy ?

When matching on ModifyKind, it is moved into the match and so the event cannot be used anymore.
I believe it should be Copy just like the other enums, so that this use case is easier and the API is more uniform.

grafik

@0xpr03
Copy link
Member

0xpr03 commented Apr 24, 2023

I would suggest matching over &event. Still, I would merge a PR for this.

dfaust added a commit to dfaust/notify that referenced this issue May 9, 2023
dfaust added a commit to dfaust/notify that referenced this issue May 9, 2023
0xpr03 pushed a commit that referenced this issue May 15, 2023
dfaust added a commit to dfaust/notify that referenced this issue May 15, 2023
0xpr03 pushed a commit that referenced this issue May 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants