Skip to content

String compare #7

Open
Open

Description

@JonathanWilbur

This library produces a Cow<str> from its functions, which may allocate a new string if there is "prepping" to do. But would there be an efficient way to directly compare two strings as if they were string-prepped without actually doing it?

I would think it would be something like:

  1. Akip all leading spaces, then
  2. Any white space characters get treated like a space character and any number of space characters match one or more spaces in the other string, then
  3. Case-fold, character by character
  4. etc.

The theory is that a stringprep comparison could be done without ever allocating a new string. This would be a great feature to have!

Activity

  1. sfackler commented on Sep 1, 2023

    @sfackler
    Owner

    In principle that seems like a thing we could add, but I'd want to make sure it was done in a way that didn't involve duplicating the prep logic twice for each variant.

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

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