dtolnay / paste

Macros for all your token pasting needs
Apache License 2.0
1.02k stars 56 forks source link

Readme and code identifies PascalCase as camelCase #72

Open prestwich opened 2 years ago

prestwich commented 2 years ago

readme uses an initial capital in "CamelCase", while camel case is typically understood to not capitalize the initial letter

Reading the code it appears that $var:camel modifier converts to PascalCase rather than camelCase

ishitatsuyuki commented 2 years ago

I'm currently in need of an actual camelCase modifier to generate JSON names (with stringify!), and I wonder if it's better to go down the path of doing a breaking change rename, or paste will simply never support camelCase as it's rarely used in Rust code and the breaking change is too confusing. @dtolnay thoughts?

ishitatsuyuki commented 2 years ago

On second thought, I think putting the new option as lower_camel is also a possibility, while the existing one can be optionally aliased to upper_camel for clarity.

kevinheavey commented 2 years ago

I've published a hacky fork that uses lower camel case: https://crates.io/crates/camelpaste

I won't be maintaining it though so consume at your own risk

prestwich commented 2 years ago

I also published a fork using convert_case under the name affix. wanted to completely outsource the casing logic 😅