-
Notifications
You must be signed in to change notification settings - Fork 184
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
Consider having private fields for DataLocale #5989
Comments
I think keep them the way they are, in a non_exhaustive struct. We can add things, but it would likely break behavior anyway if we removed things. |
We should align them with the other types in |
No, because this concept of a "data locale" is not yet in a spec; it is a design doc that got some review. Even if/when we turn it into a spec, it should sit as a preview for a while.
Yes
Seems unnecessary, but we could add it.
Yes |
Data Locale 1.0 never had to change... |
I am with Shane here - I don't think what we now have as Data Locale is what we would want to expose as stable public struct. It seems keeping it hidden as an internal struct is correct. |
Consensus to keep the status quo, and add more convenience constructors. Maybe add a macro. |
Split off from #5785
After #5988, DataLocale is now in
locale_core
.#5875 wanted it to have private fields, but locale fallback (in the locale crate) makes heavy use of these fields, reading from them and mutating them. The fallback iterator steps operate on
&mut DataLocale
. Migrating this to encapsulated private fields seems to be of little benefit.The main benefit of private fields is to signpost users away from writing directly to the fields (they should use the Locale/LanguageIdentifier
From
impls). We're unlikely to change the composition of this type any time soon, the stability benefit is not why we want this. Perhaps we can mark these hidden? Or do nothing?cc @zbraniecki @sffc @robertbastian
The text was updated successfully, but these errors were encountered: