I'm trying to play with macro and create a simple macro that create simple u32 flags.
I have an error and I understand why, but I don't know how I can work around the problem.
My first attempt was to create a simple ident:literal pair. But it's flags so it can also be ident:expr.
How can I adjust this macro to allow this?
I want that the macro can accept a literal if we give a literal or a expr if we give an expr
Line 3 $($field:ident= $value:literal,)+ just allow literal, but I want to accept literal or expr depending of what I give the important is that literal is u32 and expr result is also u32.
A big thank you! This is exactly what I need.
I don't understand what is the const _: () = {...} is this just the way to create a nested name space? With an unnamed constant?
There is no other way? using a constant to declare a impl works but the way to do it is pretty strange