-
Notifications
You must be signed in to change notification settings - Fork 324
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
Pascal case primitives #565
Conversation
So I was thinking about this, and my feeling is that the previous (now merged) PR that allows for different separators, is possibly not that useful (at least I can't think of a use case where someone would want a different character to What we ultimately want is to be able to PascalCase generated types/typedefs. So my proposal is to merge the two (remove underscores and PascalCase primitives), to something like |
|
Yes, although I'm also suggesting they could be merged into one option.
OK, I'm just struggling to think of a use case where someone would want a different |
@emilio please review the updated changes when you have time. Thank you. |
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.
This looks generally good, but I have some nits and one error in to_str. I'm still not a fan of removing an existing option for mangle_separator
somewhat arbitrarily, but I guess it's relatively new so it can be fine.
Can you squash the commits too?
20906d8
to
7e0e2a8
Compare
… for PascalCase conversion
Fix warnings Tests passed! Fix refactor mistake Add #[cfg(test)] to import Rename to rename_types
7e0e2a8
to
caf256b
Compare
Thanks! This looks fine. I have a few nits but I addressed them in a follow-up commit in #575. In particular, the rename_types should probably be on its own subsection of the configuration, otherwise being under |
Closing because I merged this in #575 |
This properly addresses our use case where we want to the default of e.g.
MyType______c_char
to beMyTypeCChar
. The previous PR did not take thec_char
type or similar into account, only capitalising the first letter for e.g.MyTypeU32
.