Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatibility with heck crate #31

Open
4 tasks
frozenlib opened this issue Jul 29, 2023 · 0 comments
Open
4 tasks

Incompatibility with heck crate #31

frozenlib opened this issue Jul 29, 2023 · 0 comments

Comments

@frozenlib
Copy link
Owner

frozenlib commented Jul 29, 2023

The recognition of word boundaries when using style = "..." differs from that used in heck crate.

When HTTPClient is converted to snake case, it will appear as follows:

  • parse_display: httpcleint
  • heck: http_client

This is due to the lack of implementation of rule 3 of the heck crate's word boundary definition in parse_display:

  1. All underscore characters are considered word boundaries.
  2. If an uppercase character is followed by lowercase letters, a word boundary is considered to be just prior to that uppercase character.
  3. If multiple uppercase characters are consecutive, they are considered to be within a single word, except that the last will be part of the next word if it is followed by lowercase characters (see rule 2).

I plan to adopt the same transformation as the heck crate in the future. Prior to this, I would like to release a version that will result in a compile error in the event of any incompatibility.

Steps

  • Implement a feature that triggers a compile error when incompatibility arises.
  • Release a version that triggers a compile error when incompatibility arises.
  • Implement a transformation that is compatible with heck.
  • Release a version that performs a transformation compatible with heck.
@frozenlib frozenlib changed the title Incompatibility with the heck crate Incompatibility with heck crate Jul 29, 2023
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

No branches or pull requests

1 participant