Skip to content
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

Way to get tuple members in snake case form. #2

Open
IamTheCarl opened this issue Dec 9, 2023 · 0 comments
Open

Way to get tuple members in snake case form. #2

IamTheCarl opened this issue Dec 9, 2023 · 0 comments

Comments

@IamTheCarl
Copy link

Great library, saves me a ton of time and effort.
I'm using it to create an ECS framework for retro consoles.

I've ran into situations where I need to generate variables referencing each member of the tuple. For now I just use a crate called casey to convert the member names to lowercase: https://github.com/IamTheCarl/micro_ecs/blob/master/src/storage/tuples.rs#L33

This problem can be worked around by storing all the values in a tuple (and I've done this in situations where casey doesn't work) but I feel individually named variables are more readable when expanding output using cargo expand.

I think the convenience of this crate could be improved by adding two more meta variables.

  • #member0
    • The member name but in lower case.
  • #_member0
    • The member name but in lower case and starting with an underscore.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant