Skip to content

Conversation

@gagath
Copy link

@gagath gagath commented Jan 26, 2021

Closes #1530.


// Parse `#[serde(alias_all = "foo")]`
Meta(NameValue(m)) if m.path == ALIAS_ALL => {
if let Ok(s) = get_lit_str(cx, ALIAS_ALL, &m.lit) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PascalCase and camelCase differs only by the first character, maybe we can have an optimization to not check all the characters twice?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure to understand, the renaming is done somewhere else and is not impacted by this change. I think this optimization is not needed and would be hard to implement given current implementation.

Copy link
Member

@dtolnay dtolnay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! I am closing because I would prefer not to build this new attribute into serde_derive. Over time since 1.0 I have tried to be increasingly selective about adding more attributes, approaching a moratorium on new attributes, to prevent the list from expanding forever and destroying compile times, and to curb the superlinear complexity of attributes interacting with each other. I think this one is just too uncommonly applicable to make sense adding right now.

@dtolnay dtolnay closed this Feb 28, 2021
@DzenanJupic
Copy link

DzenanJupic commented Sep 29, 2021

@dtolnay Given, that #1530 and this PR received exclusively positive feedback (there's even a Readdit Reddit thread and a blog post covering the problem and the issue), is there a likelihood that you will reopen this PR at some point? Or is #1530 just a dead issue that will eventually be closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Add alias_all attribute for containers similar to rename_all

4 participants