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

Be more consistent about options modules #5991

Open
sffc opened this issue Jan 14, 2025 · 1 comment
Open

Be more consistent about options modules #5991

sffc opened this issue Jan 14, 2025 · 1 comment
Labels
discuss Discuss at a future ICU4X-SC meeting

Comments

@sffc
Copy link
Member

sffc commented Jan 14, 2025

icu_datetime has an options module which is public.

icu_collator and icu_segmenter have a private options module and re-export the things from the top level.

Haven't done an audit of the other crates.

Should we be more consistent?

@zbraniecki @Manishearth

@sffc sffc added the discuss Discuss at a future ICU4X-SC meeting label Jan 14, 2025
@sffc sffc added this to the ICU4X 2.0 Stretch ⟨P2⟩ milestone Jan 14, 2025
@Manishearth
Copy link
Member

Manishearth commented Jan 14, 2025

I'm not overly bothered by this, individual crate organization in this sense has to do with how cluttered the crate is. If the crate has a single main type, it's not too bad to clutter the root module. If it has many different types it might want an options module.

Overall options are required to be specified in a lot of places so having short imports is nice. Perhaps we should default to hoisting these types to the top unless the crate has a lot of modules and types, in which case we put them wherever it makes sense.

I think "options types are in a module in some crates and not in others" is low-confusion: I don't think people will be copy pasting code for working with different ICU4X components, they're already quite different.

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

2 participants