Casey
Case transforming macros
Casey transforms the case of given input ident
s.
Niche but maybe useful in other macros.
use ;
lower!; // renders: `abc`
upper!; // `ABC`
snake!; // `a_b_c`
pascal!; // `AbC`
shouty!; // `A_B_C`
Token Stream
Casey macros can operate on TokenStream
s e.g.
snake!;
assert!;
assert!
All ident
tokens in the stream will have the case transformation applied (keywords and attribute macros will be ignored).
Gotchas
Type names, including built-in types are not considered keywords e.g. bool
, usize
, i32
etc. and will be transformed by casey.
pascal!; // renders: `let Test: Bool = true;`