Closed nmlt closed 1 year ago
Can you explain what your use case is for this? I'm already not quite clear on what people use the title case conversion for.
I'm using heck via strum, to convert my enum names to displayable strings. In this case I have an SQL operator enum, and would like to transform GroupBy
to "GROUP BY".
I don't really have time to maintain this crate anymore (I took over after withoutboats stopped maintaining it). I suggest looking for alternatives if what is there now doesn't suit your needs.
I can add UPPER CASE
What actual use case do you have for this? Is it not filled by str::to_uppercase
from std?
Word boundaries are represented as spaces in UPPER CASE, but remain unchanged in str::to_uppercase.
Okay, but that only answers half of my question. What's your actual use case?
The same as the use-case for the entire crate. Case conversion, I don't personally use this library, but someone else might want this functionality(someone clearly does).
Oh right, something was mentioned above. @nmlt is that code open-source? I would like to understand the context better.
I already opened a PR with the requested features
I know, but I'm very hesitant about merging it. I never said I would accept a PR for it. If I were to add every casing rule imaginable, the API would be flooded with things most people have never heard of and will never need. There is another PR open with dot.case
and an uppercase version of the same.
I'm sorry but for now I'll close this. There is no obvious name for uppercase with spaces (or lowercase with spaces), and I have no reason to believe that they fill a significant use case so far. They can already be emulated with the current API (although it's not as efficient as proper support) by transforming to title case and calling .to_lowercase()
or .to_uppercase()
afterwards.
I'm open to reading about the mentioned use case in more detail, or reading about additional use cases. But without that, I'm not accepting PRs for this and will thus close the issue.
Oh right, something was mentioned above. @nmlt is that code open-source? I would like to understand the context better.
The code is a mess and abandoned, but here’s my use case: https://github.com/nmlt/TeeBenchWeb/blob/fb15aaf9164d2c7902a172f28703f3570e724981/common/src/commit.rs#L11
I don’t think this will convince you, because I solved the issue with the strum macros: going from enum name “GroupBy” to “GROUP BY”.
Edit: to make the actual use case more clear: The enum represents a
The strum macros are somewhat interesting, so they do alread support an "uppercase" mode where there are just no spaces. That's what I meant for there not being an obvious name for this casing convention with spaces - uppercase is clearly too generic.
Anyways, if #6 is implemented this will be possible with heck. I'm not sure how strum would expose it to users though.
There is already "Title Case" so it seems it would make sense to also support converting all letters to upper case and keeping the separator spaces.