Skip to content

Clean up API ergonomics for calendar methods #235

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

Merged
merged 3 commits into from
Mar 4, 2025

Conversation

nekevss
Copy link
Member

@nekevss nekevss commented Mar 4, 2025

This PR removes a lot of the TemporalResult returns from most of the calendar methods.

This is made possible on most methods because we no longer need to support Not Yet Implemented errors.

There is also an expect added in the conversion from IsoDate -> icu_calendar::Date<Iso>. This is tested to be valid in a test added to iso.rs for the max bounds of IsoDate.

The core changes in this PR are made to iso.rs and calendar.rs by extension. The rest is mostly updating all the calendar methods accordingly.

Note: calendar methods that are still not fully implemented across various calendars were left as a TemporalResult

@nekevss nekevss requested a review from jedel1043 March 4, 2025 03:15
@nekevss nekevss added the C-api Changes related to the public API label Mar 4, 2025
Copy link
Member

@jedel1043 jedel1043 left a comment

Choose a reason for hiding this comment

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

Good to know we can directly convert to ICU4X's dates without much issue!

@nekevss
Copy link
Member Author

nekevss commented Mar 4, 2025

Yeah, it's nice to know and have that tested reliably for our max and min dates.

@nekevss nekevss merged commit 3a8c258 into main Mar 4, 2025
8 checks passed
@nekevss nekevss deleted the nonfallible-icu4x-conversion branch March 4, 2025 04:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-api Changes related to the public API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants