-
Notifications
You must be signed in to change notification settings - Fork 125
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
impl rename_all for #[derive(Display)] (#216) #443
base: master
Are you sure you want to change the base?
Conversation
23cd199
to
d76973d
Compare
d76973d
to
2ebbf3e
Compare
/// Interpolation [`FmtAttribute`]. | ||
fmt: Option<FmtAttribute>, | ||
|
||
/// Addition trait bounds. | ||
bounds: BoundsAttribute, | ||
|
||
/// Rename unit enum variants following a similar behavior as [`serde`](https://serde.rs/container-attrs.html#rename_all). | ||
rename_all: Option<T>, |
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.
@ModProg instead of modifying the ContainerAttributes
with an additional slot (which is useless for the Debug
), I think it's better to leave it "as is", and:
- Move
RenameAllAttribute
intodisplay
module. - Inside
display
module do:and parse it asstruct ContainerAttributes { rename_all: RenameAllAttribute, common: super::ContainerAttributes, }
Either<RenameAllAttribute, super::ContainerAttributes>
to omit repeating parsing of thesuper::ContainerAttributes
twice.
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 thought It'd make sense to allow to have rename_all
and bounds
in the same attribute. But that will only at most save one line anyway.
Resolves #216
Checklist