#string-literal #pascal-case #literals #identifier #convert #macro #ident

macro pascal_ident_to_string

A macro to convert an identifier to a string literal in pascal case

1 unstable release

0.1.0 Mar 11, 2023

#1720 in Procedural macros

MIT license

3KB

pascal_ident_to_string

pascal_ident_to_string exports a procedural macro to convert an identifier to a string literal in pascal case

Motivation

I like my identifiers snake-y. The Windows APIs don't. So, this macro helps me with converting the function names to pascal case string literals before passing them to GetProcAddress

Example

use pascal_ident_to_string::pascal_string;

let my_rusty_ident = pascal_string!(my_rusty_ident);
assert_eq!(my_rusty_ident, "MyRustyIdent");

License: MIT


lib.rs:

pascal_ident_to_string exports a procedural macro to convert an identifier to a string literal in pascal case

Motivation

I like my identifiers snake-y. The Windows APIs don't. So, this macro helps me with converting the function names to pascal case string literals before passing them to GetProcAddress

Example

use pascal_ident_to_string::pascal_string;

let my_rusty_ident = pascal_string!(my_rusty_ident);
assert_eq!(my_rusty_ident, "MyRustyIdent");

Dependencies

~170KB