Skip to content

Commit 600a0e4

Browse files
authored
Switch FFI calendar APIs over to using AnyCalendarKind for input (#324)
We clone these calendars anyway; the current API forces clients to retain some allocated Calendar objects for no real reason. Let's standardize around using kinds. This breaks the CAPI, but I'm not using this stuff yet. If I decide to start using this before a release, I'll add some compat layer for the APIs I care about.
1 parent 8011865 commit 600a0e4

23 files changed

+111
-72
lines changed

src/builtins/core/calendar.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,12 @@ impl Calendar {
178178
matches!(self.0 .0, AnyCalendar::Iso(_))
179179
}
180180

181+
/// Returns the kind of this calendar
182+
#[inline]
183+
pub fn kind(&self) -> AnyCalendarKind {
184+
self.0 .0.kind()
185+
}
186+
181187
/// `CalendarDateFromFields`
182188
pub fn date_from_partial(
183189
&self,

temporal_capi/bindings/c/Calendar.h

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

temporal_capi/bindings/c/PlainDate.h

Lines changed: 5 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

temporal_capi/bindings/c/PlainDateTime.h

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

temporal_capi/bindings/c/PlainMonthDay.h

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

temporal_capi/bindings/c/PlainYearMonth.h

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

temporal_capi/bindings/cpp/temporal_rs/Calendar.d.hpp

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

temporal_capi/bindings/cpp/temporal_rs/Calendar.hpp

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

temporal_capi/bindings/cpp/temporal_rs/PlainDate.d.hpp

Lines changed: 5 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

temporal_capi/bindings/cpp/temporal_rs/PlainDate.hpp

Lines changed: 9 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)