-
Notifications
You must be signed in to change notification settings - Fork 148
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: Add attribute for types that don't implement Default #245
Comments
Hey @ewoolsey, there have been a few similiar requests, and I think this would be a very good fit for |
I think I would err towards a design like the one serde uses |
@Peternator7 since posting this I’ve found an alternative solution (for my specific use case) with the clap Subcommand derive macro. My workload is pretty high the next few weeks so I’m not sure I’ll have time to contribute for a while, although I would like to get my hands dirty with some more involved proc macro projects. If you decide to pickup the torch on this let me know, I do think this would be a great addition to strum. |
I will knock this out |
I got a working proto type of this at the Variant Level + The Inner Variant Fields. Tests all pass and I didn't break anything. I plan on refactoring a little bit of the code, so Its easier to add Non-Derive / Non-Variant level macros (inner variant named fields), if its required in the future. |
Heres a quick example of how it could look:
This would be very useful when working with types from external crates, or when implementing Default doesn't otherwise make sense.
The text was updated successfully, but these errors were encountered: