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:
- Akip all leading spaces, then
- 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
- Case-fold, character by character
- 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!
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:
The theory is that a
stringprepcomparison could be done without ever allocating a new string. This would be a great feature to have!