-
Notifications
You must be signed in to change notification settings - Fork 185
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
Conversation
#[cfg(feature = "datagen")] | ||
mod datagen; | ||
#[cfg(feature = "datagen")] | ||
pub use datagen::*; |
There was a problem hiding this comment.
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
#[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); | ||
} |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
Co-authored-by: Shane F. Carr <[email protected]>
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 tonew
.I also added a
supported_markers
method to theExportableDataProvider
trait; datagen will by default now support all available markers for the provider. This lets me remove theall_markers
methods from the driver crate, which didn't make sense there. This allows removing theall_markers
,marker
, andmarkers
methods fromicu_datagen
, so that it's registry-agnostic.markers_for_bin
moves toicu
, as that needs theicu
crate anyway and only supports markers inicu
.