icu4x
icu4x copied to clipboard
Refactor: Rename uncategorized unit struct to erased
Description
- Rename
MeasureUnitandMeasureUnitParsertoErasedMeasureUnitandErasedMeasureUnitParserrespectively - Updating all references throughout the codebase.
- Additionally, remove the old
MeasureUnitandMeasureUnitParserbindings from FFI and update related documentation and tests accordingly.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with :thumbsup: and :thumbsdown: on @gemini-code-assist comments to provide feedback.
Not a big fan of either naming
How about FixedCategoryMeasureUnit and AnyMeasureUnit
I am adding this PR to the ICU4X standup discussion in order to agree on a specific name
Some notes from 2025-06-10:
- @robertbastian the parser should return a
CategorizedMeasureUnitand notErasedMeasureUnitand not depend on compiled_data - @sffc What data does the unit parser need? I think it is just the
iddata? - @younies The parser needs to have
idsdata and also thecategory-- also we need the conversion data. - @sffc : we need
AnyMeasureUnitbecause not all categories are enumerable. For example,square-meter-square-second-per-square-kilogram. - @younies : we can start now by rename
- @robertbastian : if you rename now we have to discuss FFI names as well, as MeasureUnit is already exposed there. lets get the formatter API done and then we can discuss what the best names for all the pieces are
- @younies Okay, lets get the categorized formatter done, at lease we can make also the duration formatter ready for the graduation too. After that we will look at the
AnyMeasureUnitFormatter - @Manishearth and @sffc , we need to have the whole crate implemented before graduation, and also include MixedUnits too
- @robertbastian : everything that you want to add in the future should be added before graduation, otherwise it might not work
- @Manishearth : A trait based solution would be nice, where you have a single
MeasureUnitFormatter<M>type, and it has specific constructors for AnyUnit, LengthUnit, Meter, CompoundLengthUnit, etc, which all implement the same trait. - @sffc : calendar conversion is to DateTimeFormatter as unit conversion is to MeasureUnitFormatter, because it changes the API (you need to convert the input). Field sets are to DateTimeFormatter as unit categories are to MeasureUnitFormatter: they impact how much data you need to load, but they don't themselves impact the API signature.