-
Notifications
You must be signed in to change notification settings - Fork 23
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 get/set functions #59
Labels
Comments
I agree, I found myself wishing for the ability to give getters a different name that makes more sense to the outside. I think the syntax could be |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've been using getset on some configuration structs. I use it to derive almost all the getters, but I have some that are boolean and in the struct it makes sense to have them as
enable_some_thing
orallow_other_thing
but when I use a function to query them it is more readable assome_thing_enabled
orother_thing_allowed
. I could just do the renaming through serde as a work around or just write the functions out like I've been doing instead of using getset but it would be nice to have the ability like serde to rename what is generated. It will probably require the current proc macro api annotations to change, but I think it would be quite useful.The text was updated successfully, but these errors were encountered: