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

feature request: default on Clone #108

Open
bryanlarsen opened this issue Mar 22, 2023 · 0 comments
Open

feature request: default on Clone #108

bryanlarsen opened this issue Mar 22, 2023 · 0 comments

Comments

@bryanlarsen
Copy link

problem:

I have a struct that needs to be Clone. It contains a member foo with type Option where Foo isn't Clone. On clone I'd like foo to be None (aka Option::default()).

Having used derivative on Debug in the past to do similar things, and having used default in serde, I expected that derivative would let me do this easily.

feature request:

add a field attribute "default" for Clone, with the same behavior as serde's default: https://serde.rs/attr-default.html

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

No branches or pull requests

1 participant