-
Notifications
You must be signed in to change notification settings - Fork 524
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
Make a way so that prost-derive doesn't necessarily derive Debug for you #334
Comments
Alternatively, I think maybe we can have |
Yeah I think ideally we would not include the |
im interested in this as well. removing Debug from |
i haven't done anything on this, feel free to give it a shot 😄 |
cool. i'll fix this then. do we want it via codegen option in prost build so it can be set via |
I would suggest that, it doesn't make sense for it to be an option in Instead, this feature should be part of prost-derive config (affecting the code created by the proc-macro), and either do it like (1) make a proc macro attribute that affects
To do this, you would look in the OR do exactly what @danburkert suggested above, and just have a completely separate derive macro for the prost::Debug thing.
Then you would have basically two proc-macros being offered by prost-derive. That's probably simpler unless for some reason rustc won't let you make a custom derive for |
I mainly meant the ergonomics of it for end users. if i wanna setup my codegen in my build.rs as is usually the case, i wanna be able to specify whether or not to derive debugs, so i still think prost-build needs to add that option in config. as for implementation, the problem with prosts' Debug is that its tied internally to prosts' |
Big +1 to this - just ran into this being a problem where I'd like to customize my |
Also needing this except for Default, as I'd like to set the default values myself. It would be great. Instead of creating new configuration options for each derive argument, |
@cortopy one issue is, in proto3 they dropped support for custom default fields, so if prost allows to have custom defaults it's somewhat a hazard for proto3 users. But maybe it's okay and helpful to proto2 users? |
@garbageslam totally right and that's why sometimes I need to implement Default trait myself. I didn't mean the implementation of |
+1 on this, and any status update on this? it looks like there was a PR open from 2+ years ago? |
+1 from me. Sometimes data is secret. In that case one wants to either override debug/display or completely avoid it. |
If this comment helps you, please consider updating the crate documentation to make these features more findable. |
Sometimes you have structs that you want to give a custom implementation of Debug, but if you do that then they cannot derive Message which is unfortunate.
Would you take a patch that allows something like the following?
The text was updated successfully, but these errors were encountered: