Open zbraniecki opened 2 weeks ago
Duplicate of #5786
Actually let's keep this issue open so we have one discussion per thread.
So the main problem here is that DataLocale lives in icu_provider
and it needs to be efficiently constructed from this type that lives in icu_locale_core
.
Can we just move DataLocale into icu_locale_core
?
My personal opinion is that I think it is silly and over-designed to try and keep the types exported from core crates as minimal as possible and put specialized types into other crates. I prefer "useful" core crates: ones that export types that its dependents need.
Conclusion:
LocalePreferences
gets private fields&LanguageIdentifier
and &Locale
DataLocale
moves to icu_locale_core::DataLocale
LocalePreferences
has two conversion functions into a DataLocale
: to_data_locale_language_priority(self)
, to_data_locale_region_priority(self)
DataLocale
gets private fieldsicu_provider::marker
to call the right DataLocale constructor based on the markerDataMarker::bind
to be a helper function in that moduleLGTM: @Manishearth @robertbastian @sffc @zbraniecki
_Originally posted by @sffc in https://github.com/unicode-org/icu4x/pull/5729#discussion_r1831619407_