Skip to content

Commit

Permalink
ffi
Browse files Browse the repository at this point in the history
  • Loading branch information
Manishearth committed Sep 12, 2024
1 parent 4374583 commit 159bfaa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions ffi/capi/src/date.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ pub mod ffi {

/// Returns the extended year in the Date
#[diplomat::rust_link(icu::calendar::types::YearInfo::extended_year, StructField)]
#[diplomat::rust_link(icu::calendar::types::YearInfo, StructField, hidden)]
#[diplomat::attr(auto, getter)]
pub fn extended_year(&self) -> i32 {
self.0.year().extended_year
Expand All @@ -326,6 +327,8 @@ pub mod ffi {
/// Returns the era for this date,
#[diplomat::rust_link(icu::Date::year, FnInStruct)]
#[diplomat::rust_link(icu::types::Era, Struct, compact)]
#[diplomat::rust_link(icu::types::EraYear, Struct, compact)]
#[diplomat::rust_link(icu::types::YearKind, Struct, hidden)]
#[diplomat::attr(auto, getter)]
pub fn era(&self, write: &mut diplomat_runtime::DiplomatWrite) {
if let Some(era) = self.0.year().standard_era() {
Expand Down
4 changes: 3 additions & 1 deletion tools/make/diplomat-coverage/src/allowlist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,11 @@ lazy_static::lazy_static! {
"icu::calendar::types::FormattableMonth",
"icu::calendar::types::FormattableYear",
"icu::calendar::types::FormattableYearKind",
"icu::calendar::types::YearInfo",
"icu::calendar::types::DayOfYearInfo",

// Not yet exposed over FFI, Temporal doesn't need it
"icu::calendar::types::CyclicYear",

// Punted post 1.0: not strongly needed yet and don't want to lock in a solution
// Potential solutions:
// - borrow and clone (cheap as long it's not json)
Expand Down

0 comments on commit 159bfaa

Please sign in to comment.