-
Notifications
You must be signed in to change notification settings - Fork 211
Refactor MeasureUnitParser
and update related components
#6328
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
Conversation
- Removed the dependency on `ZeroTrieSimpleAscii` in `MeasureUnitParser`, replacing it with `DataPayload` for better data handling. - Introduced new constructors for `MeasureUnitParser`, including a stable constructor and an unstable one that accepts a data provider. - Updated tests to directly instantiate `MeasureUnitParser` instead of using `ConverterFactory`. - Refactored `UnitsInfo` to replace `units_conversion_trie` with `conversion_info`, aligning with the new data structure. - Adjusted related components and tests to reflect these changes, ensuring consistency across the measurement unit parsing functionality.
provider/source/src/units/info.rs
Outdated
DataError::custom("Could not create ZeroTrie from units.json data") | ||
.with_display_context(&e) | ||
})?; | ||
// TODO: now we need to create `MeasureUnitParser` in order to create the conversion info. how to do that ? |
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.
@robertbastian , @Manishearth
Now, in order to create the ConversionInfoV1, we need to have a measure unit parser, and measure unit parser is depending on UnitsInfoV1
, how can I do that ?
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 don't understand the question: things can depend on each other just fine
Co-authored-by: Robert Bastian <[email protected]>
Co-authored-by: Robert Bastian <[email protected]>
Description:
ZeroTrieSimpleAscii
inMeasureUnitParser
, replacing it withDataPayload
for better data handling.MeasureUnitParser
, including a stable constructor and an unstable one that accepts a data provider.MeasureUnitParser
instead of usingConverterFactory
.UnitsInfo
to replaceunits_conversion_trie
withconversion_info
, aligning with the new data structure.