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
Rename items with a rule #703
base: master
Are you sure you want to change the base?
Conversation
I realised this is a dupe of #419. This one has tests though. |
#include <stdint.h> | ||
#include <stdlib.h> | ||
|
||
#define capi_constant_abc 10 |
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 is basically the use case for allowing one rule per item type as well as a default global one. I don't often see lower_snake_case #defines in C, even in a largely lower_snake_case API. This PR already has the infrastructure for that, passing IdentifierType
in to ExportConfig::rename
, but hasn't implemented it (yet).
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.
So this looks probably ok, but wouldn't it be more consistent to just add a ConstantConfig::rename
field of sorts? I think the point was that some constants might want to be static
and can't be renamed, so that might be a bit trickier.
Hi. Any change of getting this merged/release soon? |
Everything else can have a rename rule. Why not items too!
Example below. Nice and neat, no
#![allow(non_camel_case_types)]
required.