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

Explicit LocaleFallbacker argument for DatagenDriver #5114

Merged
merged 8 commits into from
Jun 25, 2024

Conversation

robertbastian
Copy link
Member

@robertbastian robertbastian commented Jun 25, 2024

Datagen implicitly requires a LocaleFallbacker for most configurations, so I'd rather make it explicit so that providers that don't expose fallback themselves are exportable.

I also removed the no-fallback mode, as that can (almost, up to ["und"]) be modeled by the fallback path, and made the required settings arguments to new.

I also added a supported_markers method to the ExportableDataProvider trait; datagen will by default now support all available markers for the provider. This lets me remove the all_markers methods from the driver crate, which didn't make sense there. This allows removing the all_markers, marker, and markers methods from icu_datagen, so that it's registry-agnostic. markers_for_bin moves to icu, as that needs the icu crate anyway and only supports markers in icu.

components/icu/Cargo.toml Outdated Show resolved Hide resolved
#[cfg(feature = "datagen")]
mod datagen;
#[cfg(feature = "datagen")]
pub use datagen::*;
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Make sure we bikeshed whether this function is in a module or not with the rest of the WG

provider/baked/src/export.rs Outdated Show resolved Hide resolved
provider/blob/src/export/mod.rs Outdated Show resolved Hide resolved
provider/datagen/src/driver.rs Outdated Show resolved Hide resolved
provider/datagen/tests/test-options.rs Outdated Show resolved Hide resolved
provider/fs/src/export/mod.rs Outdated Show resolved Hide resolved
provider/icu4x-datagen/src/main.rs Outdated Show resolved Hide resolved
Comment on lines +625 to +630
#[test]
fn test_lookup() {
assert_eq!(marker_lookup().get("AndListV1Marker"), Some(&Some(icu::list::provider::AndListV1Marker::INFO)));
assert_eq!(marker_lookup().get("list/and@1"), Some(&Some(icu::list::provider::AndListV1Marker::INFO)));
assert_eq!(marker_lookup().get("foo"), None);
}
Copy link
Member

Choose a reason for hiding this comment

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

Nit: This test need not be inside the macro?

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 think it's nice to have it next to the function it tests

Copy link
Member

Choose a reason for hiding this comment

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

I prefer if you move it 15 lines down and out of the macro

@robertbastian robertbastian requested a review from sffc June 25, 2024 13:32
sffc
sffc previously approved these changes Jun 25, 2024
@robertbastian robertbastian requested a review from sffc June 25, 2024 13:39
@robertbastian robertbastian merged commit f99120b into unicode-org:main Jun 25, 2024
28 checks passed
@robertbastian robertbastian deleted the markers branch June 25, 2024 13:58
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.

None yet

2 participants