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

Split DateTimeFormat keys #774

Merged
merged 1 commit into from
Jun 11, 2021
Merged

Conversation

zbraniecki
Copy link
Member

Fixes #257

@zbraniecki zbraniecki requested a review from sffc June 8, 2021 20:46
@zbraniecki
Copy link
Member Author

@sffc does it look generally like the right direction to you? How should I handle StructProvider in such a composed bound scenario?

Copy link
Member

@sffc sffc left a comment

Choose a reason for hiding this comment

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

@sffc does it look generally like the right direction to you?

Yes, this looks like what I had in mind!

How should I handle StructProvider in such a composed bound scenario?

I would think that in order to make a StructProvider return multiple types of structs, one would have two StructProvider instances and then tie them together with another class that delegates to one or the other. Perhaps we could make a helper macro for that.

components/datetime/src/datetime.rs Outdated Show resolved Hide resolved
@jira-pull-request-webhook
Copy link

Notice: the branch changed across the force-push!

  • components/datetime/tests/datetime.rs is different

View Diff Across Force-Push

~ Your Friendly Jira-GitHub PR Checker Bot

@codecov-commenter
Copy link

codecov-commenter commented Jun 10, 2021

Codecov Report

Merging #774 (d1d8410) into main (ffd520f) will decrease coverage by 0.63%.
The diff coverage is 70.88%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #774      +/-   ##
==========================================
- Coverage   76.16%   75.52%   -0.64%     
==========================================
  Files         189      192       +3     
  Lines       12153    12296     +143     
==========================================
+ Hits         9256     9287      +31     
- Misses       2897     3009     +112     
Impacted Files Coverage Δ
components/datetime/src/provider/gregory.rs 74.64% <ø> (+2.64%) ⬆️
components/datetime/src/provider/helpers.rs 79.24% <ø> (ø)
provider/cldr/src/transform/mod.rs 10.98% <12.50%> (-0.27%) ⬇️
provider/cldr/src/transform/dates/mod.rs 41.66% <41.66%> (ø)
provider/cldr/src/transform/dates/patterns.rs 79.48% <79.48%> (ø)
provider/cldr/src/transform/dates/symbols.rs 80.88% <80.88%> (ø)
components/datetime/src/format/datetime.rs 50.00% <100.00%> (ø)
components/datetime/src/skeleton.rs 81.56% <100.00%> (ø)
provider/core/src/resource.rs 81.77% <100.00%> (+0.08%) ⬆️
...s/locale_canonicalizer/src/locale_canonicalizer.rs 76.29% <0.00%> (-19.08%) ⬇️
... and 10 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ffd520f...d1d8410. Read the comment docs.

@zbraniecki zbraniecki marked this pull request as ready for review June 10, 2021 17:52
@zbraniecki zbraniecki requested a review from sffc June 10, 2021 17:52
@zbraniecki
Copy link
Member Author

This is now ready for review.

It seems to give a 5-8% win in cargo criterion bench for me. I'm not sure why tbh because we still load both for every DateTimeFormat instance, but I assume it opens up ability to later implement logic to only load symbols if needed, right?

@coveralls
Copy link

coveralls commented Jun 10, 2021

Pull Request Test Coverage Report for Build 39aed657b0376692d800deb921232988975fa000-PR-774

  • 241 of 340 (70.88%) changed or added relevant lines in 7 files are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.05%) to 75.598%

Changes Missing Coverage Covered Lines Changed/Added Lines %
provider/cldr/src/transform/mod.rs 2 16 12.5%
provider/cldr/src/transform/dates/patterns.rs 93 117 79.49%
provider/cldr/src/transform/dates/symbols.rs 110 136 80.88%
provider/cldr/src/transform/dates/mod.rs 25 60 41.67%
Files with Coverage Reduction New Missed Lines %
provider/cldr/src/transform/mod.rs 2 10.99%
Totals Coverage Status
Change from base Build acf388649a30f8a2c3d39fa764a36c10996c7482: -0.05%
Covered Lines: 9415
Relevant Lines: 12454

💛 - Coveralls

@zbraniecki zbraniecki added the discuss Discuss at a future ICU4X-SC meeting label Jun 10, 2021
@sffc sffc requested a review from gregtatum June 10, 2021 18:32
@sffc sffc removed the discuss Discuss at a future ICU4X-SC meeting label Jun 10, 2021
Copy link
Member

@sffc sffc left a comment

Choose a reason for hiding this comment

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

LGTM!

components/datetime/src/datetime.rs Outdated Show resolved Hide resolved
@jira-pull-request-webhook
Copy link

Notice: the branch changed across the force-push!

  • components/datetime/src/datetime.rs is different
  • components/datetime/tests/datetime.rs is different

View Diff Across Force-Push

~ Your Friendly Jira-GitHub PR Checker Bot

@zbraniecki zbraniecki requested a review from sffc June 10, 2021 18:57
Copy link
Member

@gregtatum gregtatum left a comment

Choose a reason for hiding this comment

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

LGTM!

@zbraniecki zbraniecki merged commit feb1add into unicode-org:main Jun 11, 2021
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.

Split date time data into smaller data keys?
5 participants