This repository has been archived by the owner on Oct 6, 2024. It is now read-only.
Added test for lower casing corner case + fix #61
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Thanks for the really nifty crate! I came across a small issue recently when writing a program that makes heavy use of meta-programming, including of the paste crate.
I have a string of the form
ACMECorp
. I use bothpaste
to convert it to lower snake case when it's an identifier, as well asinflector
when it's a value.paste
converts the string asa_c_m_e_corp
, whereasinflector
converts it toacme_corp
. To me, the latter solution feels like the more idiomatic way to do this case conversion.I was able to reproduce this example by writing a test against the
ACMECorp
identifier. I got it to fail, and tried to change the original implementation to match theinflector
behavior, but the logic turned out to be too complex. And indeed, in the inflector code, there is quite a bit more logic dealing with this sort of complexity. So I gave up and added a dependency oninflector
.I noticed that you have no other dependencies in this crate, so I don't know to what extent this is okay as far as the main branch is concerned, but this does solve my own problem for the time being. I figured I would share what I have so far, since this is a working solution for a small but surprisingly annoying problem.