Skip to content
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

Open
Manishearth opened this issue Jan 14, 2025 · 0 comments
Open

Consider having private fields for DataLocale #5989

Manishearth opened this issue Jan 14, 2025 · 0 comments
Labels
discuss Discuss at a future ICU4X-SC meeting

Comments

@Manishearth
Copy link
Member

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

@Manishearth Manishearth added the discuss Discuss at a future ICU4X-SC meeting label Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discuss Discuss at a future ICU4X-SC meeting
Projects
None yet
Development

No branches or pull requests

1 participant