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

Convert snake_case to mixedCase at compile time instead of runtime #26

Open
awaitlink opened this issue Jun 11, 2022 · 0 comments
Open
Labels
enhancement New feature or request methods This applies to the `rvk_methods` crate (or to the `methods` module before the crate split)

Comments

@awaitlink
Copy link
Owner

The rvk_methods crate currently uses macros to "generate" functions for all methods. The issue is that in order to convert snake_case names into mixedCase names expected by the VK API, a static HashMap is initialized for each category at runtime.

This is not ideal, as it should be possible to generate everything at compile time by using proc macros and/or build.rs.

https://github.com/u32i64/rvk/blob/64aa7bac9e95f833f0c5ba30633cf2a29c22f14d/rvk_methods/src/lib.rs#L18-L60

@awaitlink awaitlink added enhancement New feature or request methods This applies to the `rvk_methods` crate (or to the `methods` module before the crate split) labels Jun 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request methods This applies to the `rvk_methods` crate (or to the `methods` module before the crate split)
Projects
None yet
Development

No branches or pull requests

1 participant