sea-query icon indicating copy to clipboard operation
sea-query copied to clipboard

enum_def could derive IdenStatic

Open jclulow opened this issue 2 years ago • 1 comments

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?

jclulow avatar Nov 22 '23 21:11 jclulow

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

tyt2y3 avatar Nov 22 '23 22:11 tyt2y3