Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sffc committed Oct 18, 2024
1 parent 0d517fe commit cd5dff7
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 31 deletions.
2 changes: 1 addition & 1 deletion components/datetime/benches/datetime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
mod fixtures;

use criterion::{criterion_group, criterion_main, Criterion};
use icu_datetime::neo::FixedCalendarDateTimeFormatter;
use icu_datetime::FixedCalendarDateTimeFormatter;

use icu_calendar::{Date, DateTime, Gregorian, Time};
use icu_locale_core::Locale;
Expand Down
1 change: 1 addition & 0 deletions components/datetime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,5 @@ pub use format::neo::{FormattedDateTimePattern, LoadError, SingleLoadError, Type

pub use neo::DateTimeFormatter;
pub use neo::FixedCalendarDateTimeFormatter;
pub use neo::FormattedNeoDateTime;
pub use neo_skeleton::NeoSkeletonLength;
2 changes: 1 addition & 1 deletion components/datetime/src/neo_pattern.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ size_test!(DateTimePattern, date_time_pattern_size, 32);
/// ```
///
/// [`DateTimeFormatter`]: crate::DateTimeFormatter
/// [`FormattedNeoDateTime::pattern`]: crate::neo::FormattedNeoDateTime::pattern
/// [`FormattedNeoDateTime::pattern`]: crate::FormattedNeoDateTime::pattern
/// [`TypedDateTimeNames`]: crate::TypedDateTimeNames
#[derive(Debug)]
pub struct DateTimePattern {
Expand Down
2 changes: 1 addition & 1 deletion components/icu/examples/tui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ use icu::locale::locale;
use icu::plurals::{PluralCategory, PluralRules};
use icu::timezone::TimeZoneInfo;
use icu_collections::codepointinvlist::CodePointInversionListBuilder;
use icu_datetime::neo::FixedCalendarDateTimeFormatter;
use icu_datetime::neo_marker::NeoYearMonthDayHourMinuteSecondTimeZoneOffsetMarker;
use icu_datetime::neo_skeleton::NeoSkeletonLength;
use icu_datetime::FixedCalendarDateTimeFormatter;
use icu_timezone::CustomZonedDateTime;
use std::env;
use writeable::adapters::LossyWrap;
Expand Down
40 changes: 20 additions & 20 deletions ffi/capi/src/datetime_formatter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pub mod ffi {
/// An ICU4X TimeFormatter object capable of formatting an [`Time`] type (and others) as a string
#[diplomat::rust_link(icu::datetime, Mod)]
pub struct TimeFormatter(
pub icu_datetime::neo::FixedCalendarDateTimeFormatter<(), NeoHourMinuteMarker>,
pub icu_datetime::FixedCalendarDateTimeFormatter<(), NeoHourMinuteMarker>,
);

#[diplomat::enum_convert(icu_datetime::neo_skeleton::NeoSkeletonLength, needs_wildcard)]
Expand All @@ -51,9 +51,9 @@ pub mod ffi {
let options = NeoHourMinuteMarker::with_length(NeoSkeletonLength::from(length));

Ok(Box::new(TimeFormatter(call_constructor!(
icu_datetime::neo::FixedCalendarDateTimeFormatter::try_new,
icu_datetime::neo::FixedCalendarDateTimeFormatter::try_new_with_any_provider,
icu_datetime::neo::FixedCalendarDateTimeFormatter::try_new_with_buffer_provider,
icu_datetime::FixedCalendarDateTimeFormatter::try_new,
icu_datetime::FixedCalendarDateTimeFormatter::try_new_with_any_provider,
icu_datetime::FixedCalendarDateTimeFormatter::try_new_with_buffer_provider,
provider,
&locale,
options
Expand Down Expand Up @@ -89,7 +89,7 @@ pub mod ffi {
/// using the Gregorian Calendar.
#[diplomat::rust_link(icu::datetime, Mod)]
pub struct GregorianDateFormatter(
pub icu_datetime::neo::FixedCalendarDateTimeFormatter<
pub icu_datetime::FixedCalendarDateTimeFormatter<
icu_calendar::Gregorian,
NeoYearMonthDayMarker,
>,
Expand All @@ -108,9 +108,9 @@ pub mod ffi {
let options = NeoYearMonthDayMarker::with_length(NeoSkeletonLength::from(length));

Ok(Box::new(GregorianDateFormatter(call_constructor!(
icu_datetime::neo::FixedCalendarDateTimeFormatter::try_new,
icu_datetime::neo::FixedCalendarDateTimeFormatter::try_new_with_any_provider,
icu_datetime::neo::FixedCalendarDateTimeFormatter::try_new_with_buffer_provider,
icu_datetime::FixedCalendarDateTimeFormatter::try_new,
icu_datetime::FixedCalendarDateTimeFormatter::try_new_with_any_provider,
icu_datetime::FixedCalendarDateTimeFormatter::try_new_with_buffer_provider,
provider,
&locale,
options
Expand Down Expand Up @@ -142,7 +142,7 @@ pub mod ffi {
/// using the Gregorian Calendar.
#[diplomat::rust_link(icu::datetime, Mod)]
pub struct GregorianDateTimeFormatter(
pub icu_datetime::neo::FixedCalendarDateTimeFormatter<
pub icu_datetime::FixedCalendarDateTimeFormatter<
icu_calendar::Gregorian,
NeoYearMonthDayHourMinuteMarker,
>,
Expand All @@ -162,9 +162,9 @@ pub mod ffi {
NeoYearMonthDayHourMinuteMarker::with_length(NeoSkeletonLength::from(length));

Ok(Box::new(GregorianDateTimeFormatter(call_constructor!(
icu_datetime::neo::FixedCalendarDateTimeFormatter::try_new,
icu_datetime::neo::FixedCalendarDateTimeFormatter::try_new_with_any_provider,
icu_datetime::neo::FixedCalendarDateTimeFormatter::try_new_with_buffer_provider,
icu_datetime::FixedCalendarDateTimeFormatter::try_new,
icu_datetime::FixedCalendarDateTimeFormatter::try_new_with_any_provider,
icu_datetime::FixedCalendarDateTimeFormatter::try_new_with_buffer_provider,
provider,
&locale,
options
Expand All @@ -186,7 +186,7 @@ pub mod ffi {
/// An ICU4X DateFormatter object capable of formatting a [`Date`] as a string,
/// using some calendar specified at runtime in the locale.
#[diplomat::rust_link(icu::datetime, Mod)]
pub struct DateFormatter(pub icu_datetime::neo::DateTimeFormatter<NeoYearMonthDayMarker>);
pub struct DateFormatter(pub icu_datetime::DateTimeFormatter<NeoYearMonthDayMarker>);

impl DateFormatter {
/// Creates a new [`DateFormatter`] from locale data.
Expand All @@ -201,9 +201,9 @@ pub mod ffi {
let options = NeoYearMonthDayMarker::with_length(NeoSkeletonLength::from(length));

Ok(Box::new(DateFormatter(call_constructor!(
icu_datetime::neo::DateTimeFormatter::try_new,
icu_datetime::neo::DateTimeFormatter::try_new_with_any_provider,
icu_datetime::neo::DateTimeFormatter::try_new_with_buffer_provider,
icu_datetime::DateTimeFormatter::try_new,
icu_datetime::DateTimeFormatter::try_new_with_any_provider,
icu_datetime::DateTimeFormatter::try_new_with_buffer_provider,
provider,
&locale,
options
Expand Down Expand Up @@ -262,7 +262,7 @@ pub mod ffi {
/// using some calendar specified at runtime in the locale.
#[diplomat::rust_link(icu::datetime, Mod)]
pub struct DateTimeFormatter(
pub icu_datetime::neo::DateTimeFormatter<NeoYearMonthDayHourMinuteMarker>,
pub icu_datetime::DateTimeFormatter<NeoYearMonthDayHourMinuteMarker>,
);

impl DateTimeFormatter {
Expand All @@ -279,9 +279,9 @@ pub mod ffi {
NeoYearMonthDayHourMinuteMarker::with_length(NeoSkeletonLength::from(length));

Ok(Box::new(DateTimeFormatter(call_constructor!(
icu_datetime::neo::DateTimeFormatter::try_new,
icu_datetime::neo::DateTimeFormatter::try_new_with_any_provider,
icu_datetime::neo::DateTimeFormatter::try_new_with_buffer_provider,
icu_datetime::DateTimeFormatter::try_new,
icu_datetime::DateTimeFormatter::try_new_with_any_provider,
icu_datetime::DateTimeFormatter::try_new_with_buffer_provider,
provider,
&locale,
options,
Expand Down
16 changes: 8 additions & 8 deletions ffi/capi/src/zoned_formatter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pub mod ffi {
/// An object capable of formatting a date time with time zone to a string.
#[diplomat::rust_link(icu::datetime, Mod)]
pub struct GregorianZonedDateTimeFormatter(
pub icu_datetime::neo::FixedCalendarDateTimeFormatter<
pub icu_datetime::FixedCalendarDateTimeFormatter<
icu_calendar::Gregorian,
NeoYearMonthDayHourMinuteSecondTimeZoneGenericShortMarker,
>,
Expand All @@ -49,9 +49,9 @@ pub mod ffi {

Ok(Box::new(GregorianZonedDateTimeFormatter(
call_constructor!(
icu_datetime::neo::FixedCalendarDateTimeFormatter::try_new,
icu_datetime::neo::FixedCalendarDateTimeFormatter::try_new_with_any_provider,
icu_datetime::neo::FixedCalendarDateTimeFormatter::try_new_with_buffer_provider,
icu_datetime::FixedCalendarDateTimeFormatter::try_new,
icu_datetime::FixedCalendarDateTimeFormatter::try_new_with_any_provider,
icu_datetime::FixedCalendarDateTimeFormatter::try_new_with_buffer_provider,
provider,
&locale,
options
Expand Down Expand Up @@ -81,7 +81,7 @@ pub mod ffi {
/// An object capable of formatting a date time with time zone to a string.
#[diplomat::rust_link(icu::datetime, Mod)]
pub struct ZonedDateTimeFormatter(
pub icu_datetime::neo::DateTimeFormatter<
pub icu_datetime::DateTimeFormatter<
NeoYearMonthDayHourMinuteSecondTimeZoneGenericShortMarker,
>,
);
Expand All @@ -104,9 +104,9 @@ pub mod ffi {
);

Ok(Box::new(ZonedDateTimeFormatter(call_constructor!(
icu_datetime::neo::DateTimeFormatter::try_new,
icu_datetime::neo::DateTimeFormatter::try_new_with_any_provider,
icu_datetime::neo::DateTimeFormatter::try_new_with_buffer_provider,
icu_datetime::DateTimeFormatter::try_new,
icu_datetime::DateTimeFormatter::try_new_with_any_provider,
icu_datetime::DateTimeFormatter::try_new_with_buffer_provider,
provider,
&locale,
options,
Expand Down

0 comments on commit cd5dff7

Please sign in to comment.