ParseCallbacks::enum_variant_name is already useful for renaming enum variants. I'm using it to ensure that generated bindings fit Rust conventions. However, I'd like to also rename struct fields, and there doesn't seem to be a callback for that.
Proposal
Add fn struct_field_name to ParseCallbacks with the following signature:
This works in a similar manner to ParseCallbacks::enum_variant_name; if the user chooses to return None, the name isn't changed, but if the user chooses to return Some(string), then the field is renamed to string.
Background
ParseCallbacks::enum_variant_name
is already useful for renaming enum variants. I'm using it to ensure that generated bindings fit Rust conventions. However, I'd like to also rename struct fields, and there doesn't seem to be a callback for that.Proposal
Add
fn struct_field_name
toParseCallbacks
with the following signature:This works in a similar manner to
ParseCallbacks::enum_variant_name
; if the user chooses to returnNone
, the name isn't changed, but if the user chooses to returnSome(string)
, then the field is renamed tostring
.