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

DataIdentifier #5103

Merged
merged 6 commits into from
Jun 27, 2024
Merged

DataIdentifier #5103

merged 6 commits into from
Jun 27, 2024

Conversation

robertbastian
Copy link
Member

@robertbastian robertbastian commented Jun 21, 2024

The new union of DataLocale and DataMarkerAttributes. Unlike the previous DataLocale with auxiliary keys, there's an owned and a borrowed version.

@robertbastian robertbastian changed the title DataIdentity DataIdentifier Jun 24, 2024
robertbastian added a commit that referenced this pull request Jun 25, 2024
* Remove `icu_provider::datagen::DataConverter`, it's unused and has
been for a while
* Move `icu_provider::datagen::Iterable[Dynamic]DataProvider` to the
top-level (with the other provider traits), behind the `std` feature
  * With #5103 we can make it return `BTreeMap`, so it won't need `std`
  * This removes the `datagen` feature from `icu_provider_adapters`
* Rename `datagen` feature to `export`, as
`icu_provider_{baked,blob,fs}` call it `export`, and it doesn't do
datagen
Manishearth
Manishearth previously approved these changes Jun 26, 2024
components/datetime/src/external_loaders.rs Outdated Show resolved Hide resolved
@@ -466,14 +466,18 @@ where
+ DataProvider<XidStartV1Marker>,
NP: ?Sized,
{
fn iter_requests(&self) -> Result<HashSet<(DataLocale, DataMarkerAttributes)>, DataError> {
fn iter_ids(&self) -> Result<HashSet<DataIdentifierCow>, DataError> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I think we should use _identifiers instead of _ids

components/experimental/src/unicodeset_parse/parse.rs Outdated Show resolved Hide resolved

impl<'a> DataIdentifierBorrowed<'a> {
/// TODO
pub fn for_locale(locale: &'a DataLocale) -> Self {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issue: The function here is named for_locale but down below it is from_locale

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from_ is for an owned conversion, for_ is for references

provider/core/src/request.rs Outdated Show resolved Hide resolved
provider/core/src/request.rs Outdated Show resolved Hide resolved
Comment on lines +856 to +857
&& !(morphed_id.locale.is_empty()
&& morphed_id.marker_attributes.is_empty())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: can you write this as !morphed_id.is_empty() ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really want to define too much logic on DataIdentifier

@robertbastian robertbastian requested a review from sffc June 26, 2024 15:51
Copy link
Member

@sffc sffc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving to prevent bitrot but there are still open non-blocking comments

@robertbastian robertbastian merged commit 84ac2da into unicode-org:main Jun 27, 2024
28 checks passed
@robertbastian robertbastian deleted the id branch July 16, 2024 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants