Skip to content

Commit c7194ee

Browse files
authored
rm NeverField (#5693)
Fixes #5689
1 parent 6279b08 commit c7194ee

File tree

7 files changed

+227
-213
lines changed

7 files changed

+227
-213
lines changed

components/datetime/src/format/neo.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use crate::input;
1414
use crate::input::ExtractedInput;
1515
use crate::neo_marker::{
1616
AllInputMarkers, DateInputMarkers, DateTimeMarkers, GetField, IsInCalendar, NeoNeverMarker,
17-
NeverField, TimeMarkers, TypedDateDataMarkers, ZoneMarkers,
17+
TimeMarkers, TypedDateDataMarkers, ZoneMarkers,
1818
};
1919
use crate::neo_pattern::{DateTimePattern, DateTimePatternBorrowed};
2020
use crate::neo_skeleton::NeoDateTimeSkeleton;
@@ -2306,7 +2306,7 @@ where
23062306
+ GetField<<R::D as DateInputMarkers>::DayOfMonthInput>
23072307
+ GetField<<R::D as DateInputMarkers>::DayOfWeekInput>
23082308
+ GetField<<R::D as DateInputMarkers>::AnyCalendarKindInput>
2309-
+ GetField<NeverField>,
2309+
+ GetField<()>,
23102310
{
23112311
FormattedDateTimePattern {
23122312
pattern: self.inner.pattern,
@@ -2371,7 +2371,7 @@ where
23712371
+ GetField<<R::T as TimeMarkers>::MinuteInput>
23722372
+ GetField<<R::T as TimeMarkers>::SecondInput>
23732373
+ GetField<<R::T as TimeMarkers>::NanoSecondInput>
2374-
+ GetField<NeverField>,
2374+
+ GetField<()>,
23752375
{
23762376
FormattedDateTimePattern {
23772377
pattern: self.inner.pattern,
@@ -2436,7 +2436,7 @@ where
24362436
+ GetField<<R::Z as ZoneMarkers>::TimeZoneOffsetInput>
24372437
+ GetField<<R::Z as ZoneMarkers>::TimeZoneVariantInput>
24382438
+ GetField<<R::Z as ZoneMarkers>::TimeZoneLocalTimeInput>
2439-
+ GetField<NeverField>,
2439+
+ GetField<()>,
24402440
{
24412441
FormattedDateTimePattern {
24422442
pattern: self.inner.pattern,

components/datetime/src/input.rs

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//! formatting operations.
77
88
use crate::neo_marker::{DateInputMarkers, GetField, TimeMarkers, ZoneMarkers};
9+
use crate::scaffold::IntoOption;
910
use icu_calendar::any_calendar::AnyCalendarKind;
1011
use icu_calendar::{Date, Iso, Time};
1112
use icu_timezone::{TimeZoneBcp47Id, UtcOffset, ZoneVariant};
@@ -55,19 +56,19 @@ impl ExtractedInput {
5556
+ GetField<Z::TimeZoneLocalTimeInput>,
5657
{
5758
Self {
58-
year: GetField::<D::YearInput>::get_field(input).into(),
59-
month: GetField::<D::MonthInput>::get_field(input).into(),
60-
day_of_month: GetField::<D::DayOfMonthInput>::get_field(input).into(),
61-
iso_weekday: GetField::<D::DayOfWeekInput>::get_field(input).into(),
62-
any_calendar_kind: GetField::<D::AnyCalendarKindInput>::get_field(input).into(),
63-
hour: GetField::<T::HourInput>::get_field(input).into(),
64-
minute: GetField::<T::MinuteInput>::get_field(input).into(),
65-
second: GetField::<T::SecondInput>::get_field(input).into(),
66-
nanosecond: GetField::<T::NanoSecondInput>::get_field(input).into(),
67-
time_zone_id: GetField::<Z::TimeZoneIdInput>::get_field(input).into(),
68-
offset: GetField::<Z::TimeZoneOffsetInput>::get_field(input).into(),
69-
zone_variant: GetField::<Z::TimeZoneVariantInput>::get_field(input).into(),
70-
local_time: GetField::<Z::TimeZoneLocalTimeInput>::get_field(input).into(),
59+
year: GetField::<D::YearInput>::get_field(input).into_option(),
60+
month: GetField::<D::MonthInput>::get_field(input).into_option(),
61+
day_of_month: GetField::<D::DayOfMonthInput>::get_field(input).into_option(),
62+
iso_weekday: GetField::<D::DayOfWeekInput>::get_field(input).into_option(),
63+
any_calendar_kind: GetField::<D::AnyCalendarKindInput>::get_field(input).into_option(),
64+
hour: GetField::<T::HourInput>::get_field(input).into_option(),
65+
minute: GetField::<T::MinuteInput>::get_field(input).into_option(),
66+
second: GetField::<T::SecondInput>::get_field(input).into_option(),
67+
nanosecond: GetField::<T::NanoSecondInput>::get_field(input).into_option(),
68+
time_zone_id: GetField::<Z::TimeZoneIdInput>::get_field(input).into_option(),
69+
offset: GetField::<Z::TimeZoneOffsetInput>::get_field(input).into_option(),
70+
zone_variant: GetField::<Z::TimeZoneVariantInput>::get_field(input).into_option(),
71+
local_time: GetField::<Z::TimeZoneLocalTimeInput>::get_field(input).into_option(),
7172
}
7273
}
7374
}

components/datetime/src/neo.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,19 +129,19 @@ impl RawNeoOptions {
129129
.as_ref()
130130
.and_then(HourCycle::from_locale_value);
131131
Self {
132-
length: match GetField::<FSet::LengthOption>::get_field(field_set).into() {
132+
length: match GetField::<FSet::LengthOption>::get_field(field_set).into_option() {
133133
Some(length) => length,
134134
None => {
135135
debug_assert!(false, "unreachable");
136136
NeoSkeletonLength::Medium
137137
}
138138
},
139-
alignment: GetField::<FSet::AlignmentOption>::get_field(field_set).into(),
140-
year_style: GetField::<FSet::YearStyleOption>::get_field(field_set).into(),
139+
alignment: GetField::<FSet::AlignmentOption>::get_field(field_set).into_option(),
140+
year_style: GetField::<FSet::YearStyleOption>::get_field(field_set).into_option(),
141141
fractional_second_digits: GetField::<FSet::FractionalSecondDigitsOption>::get_field(
142142
field_set,
143143
)
144-
.into(),
144+
.into_option(),
145145
hour_cycle,
146146
}
147147
}
@@ -1367,7 +1367,7 @@ where
13671367
GetField::<<FSet::D as DateInputMarkers>::AnyCalendarKindInput>::get_field(
13681368
datetime,
13691369
)
1370-
.into(),
1370+
.into_option(),
13711371
});
13721372
}
13731373
let datetime =

0 commit comments

Comments
 (0)