paste icon indicating copy to clipboard operation
paste copied to clipboard

Readme and code identifies PascalCase as camelCase

Open prestwich opened this issue 3 years ago • 4 comments

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

prestwich avatar Nov 18 '21 00:11 prestwich

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 avatar Jun 24 '22 02:06 ishitatsuyuki

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.

ishitatsuyuki avatar Jun 24 '22 02:06 ishitatsuyuki

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

kevinheavey avatar Jul 02 '22 23:07 kevinheavey

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

prestwich avatar Jul 03 '22 18:07 prestwich