Skip to main content

csharp_type_name

Function csharp_type_name 

Source
pub fn csharp_type_name(name: &str) -> String
Expand description

Apply initialism uppercasing to a name that is already in PascalCase (e.g. an IR type name).

IR type names come directly from Rust PascalCase (e.g. GraphQLRouteConfig, ImageUrl). When such names have been processed by heck::ToPascalCase they may lose initialism capitalisation (e.g. GraphQLRouteConfigGraphQlRouteConfig). This function restores the canonical form regardless of whether the input is already correct or heck-corrupted.

Examples:

  • GraphQlRouteConfigGraphQLRouteConfig
  • GraphQLRouteConfigGraphQLRouteConfig (idempotent)
  • HttpStatusHTTPStatus