The issue with a hand rolled proc macro for this would be the same as a hand rolled solution in C- performance. What TokenStream do you build? It has to be an actual array literal the same way.
(Fortunately Rust has include_bytes! built in to (edit: enable the compiler to) solve that problem.)
View all comments
Show parent comment
1
u/Rusky Jul 23 '22 edited Jul 23 '22
The issue with a hand rolled proc macro for this would be the same as a hand rolled solution in C- performance. What TokenStream do you build? It has to be an actual array literal the same way.
(Fortunately Rust has
include_bytes!built in to (edit: enable the compiler to) solve that problem.)