Skip to content

Comments

Add an option to use convert_case#438

Open
tkr-sh wants to merge 7 commits intoPeternator7:masterfrom
tkr-sh:master
Open

Add an option to use convert_case#438
tkr-sh wants to merge 7 commits intoPeternator7:masterfrom
tkr-sh:master

Conversation

@tkr-sh
Copy link

@tkr-sh tkr-sh commented May 5, 2025

Even tho heck does the job in most of the cases, there is another crate that is also really nice to use: convert_case

convert_case has some advantages:

  • Better API to use (imo)
  • More cases support
  • Has a better snake_case function, so no need for a custom fn snakify (also, the fn snakify in heck is suboptimal. Tho I'll refactor it in another PR I think)

Notes

Backward compatibility

This PR doesn't break backward compatibility. Everything that was working previously with heck will still work.
The only case where it would be false, would have been if someone put default-features = false on strum-macros even tho there wasn't any feature.

About Case::Custom

convert_case also has a Case::Custom variant that allow creating your own case!
I didn't implemented it on this PR, tho it's totally feasible and not hard to do. But it just might be a bit too much for this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant