-
-
Notifications
You must be signed in to change notification settings - Fork 134
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
Fix issue with missing rename of Self_ #490
Conversation
Running CI now, thanks! |
Closes #489 |
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 think we should probably just strip the trailing underscore or rework the Self case to use raw identifiers like r#Self
For |
So just to make sure I've mentioned everything: The two implementations differ in:
Furthermore the code relies on the two snake cases (what serde does and what we do to determine whether a rename is needed) aligning, otherwise we will output wrong renames or unneeded renames. @arlyon could you please give an update on this or let someone else review this mr? |
Did some more digging and happy to merge this. Thanks! |
Apologies for the delay, we have a few very kind people who participate sometimes but usually when I am busy PR reviews stall. Thank you for taking the time. |
Is there anything broken with the release pipeline? The crates.io version is stuck at 0.31 and we are at 0.33 in this repository already since three weeks? @arlyon |
Yeah, I need to manually push them. One of many things with this repo I've been meaning to get around to. |
Summary
See #489.
The issue is that serde's snake case for enum variants differs from heck's snake case, especially for
Self_
(and one more unexpected case, see the diff).This was fixed by including the function used by serde, which is sadly not exported so I copy pasted it (serde is under MIT license).
The issue here is obviously that serde may change the internal function but I think this is very unlikely since it breaks all parsing code in existence and serde is no longer in alpha :)
Checklist
cargo make fmt