Skip to main content

pascal

Macro pascal 

Source
macro_rules! pascal {
    ($ident:expr => ident) => { ... };
    ($ts:expr => token_stream) => { ... };
    ($s:expr) => { ... };
}
Expand description

Converts a string or ident to PascalCase.

ยงUsage

  • pascal!("hello_world") โ†’ "HelloWorld" (String)
  • pascal!(ident => ident) โ†’ PascalCase syn::Ident
  • pascal!(token_stream => token_stream) โ†’ PascalCase last ident in path