-
Notifications
You must be signed in to change notification settings - Fork 185
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
When icu::locid::extensions::unicode::Value has a single-segment value, make it borrowable as &str #1764
Comments
hmm, treating single value segment differently from multi value segment seems to be leaking internal structure onto the API. For extension types that hold only single part, we could do For multi-part, if your goal is comparisong, I think a compromise might be to add How does it sound? |
How about changing the data model of |
Depending on the use case, I'd also be happy with a |
My goal isn't only comparison but also (in the case where special comparisons don't match) passing the extension value to the provider in the |
I have a draft PR open that changes ResourceOptions to support |
In #1833 I had to figure out how to handle it. I was able to workaround this by just comparing to a const |
Yep; in #1750, |
It's inefficient to write
icu::locid::extensions::unicode::Value
into aString
in order to get a&str
, especially whenicu::locid::extensions::unicode::Value
holds only one segment.I suggest adding a method that returns
Option<&str>
withSome(...)
if there is exactly single value segment andNone
otherwise. This would improve the API for single-segment use cases, such as collations.The text was updated successfully, but these errors were encountered: