Skip to content

Incompatibility with heck crate #31

@frozenlib

Description

@frozenlib

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions