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

enum_def could derive IdenStatic #721

Open
jclulow opened this issue Nov 22, 2023 · 1 comment · May be fixed by #769
Open

enum_def could derive IdenStatic #721

jclulow opened this issue Nov 22, 2023 · 1 comment · May be fixed by #769

Comments

@jclulow
Copy link

jclulow commented Nov 22, 2023

Looking at the enum_def attribute macro, it seems like it only produces an Iden implementation, but I'm not sure there is any reason it couldn't also derive an IdenStatic implementation?

I'd like to use the IdenStatic.as_str() routine for column variants in rusqlite row conversion routines. The Row.get() routine will accept a &str as an index, which would then avoid allocating for column names on each row conversion.

Does that seem reasonable?

@tyt2y3
Copy link
Member

tyt2y3 commented Nov 22, 2023

Yes, you are right. IdenStatic was added much later than the enum_def macro, that's why. PR is welcome.

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

Successfully merging a pull request may close this issue.

2 participants