Skip to content

Commit

Permalink
Remove "Is" prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
sffc committed Nov 20, 2024
1 parent 94b5d06 commit 0a6da33
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
6 changes: 3 additions & 3 deletions components/datetime/src/neo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use crate::raw::neo::*;
use crate::scaffold::*;
use crate::scaffold::{
AllInputMarkers, ConvertCalendar, DateDataMarkers, DateInputMarkers, DateTimeMarkers, GetField,
IsInCalendar, IsInFixedCalendar, TimeMarkers, TypedDateDataMarkers, ZoneMarkers,
InCalendar, InFixedCalendar, TimeMarkers, TypedDateDataMarkers, ZoneMarkers,
};
use crate::size_test_macro::size_test;
use crate::DateTimeWriteError;
Expand Down Expand Up @@ -330,7 +330,7 @@ where
/// ```
pub fn format<I>(&self, input: &I) -> FormattedDateTime
where
I: ?Sized + IsInFixedCalendar<C> + AllInputMarkers<FSet>,
I: ?Sized + InFixedCalendar<C> + AllInputMarkers<FSet>,
{
let input = ExtractedInput::extract_from_neo_input::<FSet::D, FSet::T, FSet::Z, I>(input);
FormattedDateTime {
Expand Down Expand Up @@ -563,7 +563,7 @@ where
datetime: &I,
) -> Result<FormattedDateTime, crate::MismatchedCalendarError>
where
I: ?Sized + IsInCalendar + AllInputMarkers<FSet>,
I: ?Sized + InCalendar + AllInputMarkers<FSet>,
{
datetime.check_any_calendar_kind(self.calendar.kind())?;
let datetime =
Expand Down
4 changes: 2 additions & 2 deletions components/datetime/src/pattern/formatter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::format::datetime::try_write_pattern_items;
use crate::input::ExtractedInput;
use crate::scaffold::*;
use crate::scaffold::{
AllInputMarkers, DateInputMarkers, DateTimeMarkers, IsInFixedCalendar, TimeMarkers,
AllInputMarkers, DateInputMarkers, DateTimeMarkers, InFixedCalendar, TimeMarkers,
TypedDateDataMarkers, ZoneMarkers,
};
use crate::DateTimeWriteError;
Expand Down Expand Up @@ -195,7 +195,7 @@ where
/// ```
pub fn format<I>(&self, datetime: &I) -> FormattedDateTimePattern<'a>
where
I: ?Sized + IsInFixedCalendar<C> + AllInputMarkers<FSet>,
I: ?Sized + InFixedCalendar<C> + AllInputMarkers<FSet>,
{
FormattedDateTimePattern {
pattern: self.inner.pattern,
Expand Down
28 changes: 14 additions & 14 deletions components/datetime/src/scaffold/calendar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ impl<O: TimeZoneModel> ConvertCalendar for TimeZoneInfo<O> {
}

/// An input that may be associated with a specific runtime calendar.
pub trait IsInCalendar {
pub trait InCalendar {
/// Checks whether this type is compatible with the given calendar.
///
/// Types that are agnostic to calendar systems should return `Ok(())`.
Expand All @@ -449,7 +449,7 @@ pub trait IsInCalendar {
) -> Result<(), MismatchedCalendarError>;
}

impl<C: Calendar, A: AsCalendar<Calendar = C>> IsInCalendar for Date<A> {
impl<C: Calendar, A: AsCalendar<Calendar = C>> InCalendar for Date<A> {
#[inline]
fn check_any_calendar_kind(
&self,
Expand All @@ -466,14 +466,14 @@ impl<C: Calendar, A: AsCalendar<Calendar = C>> IsInCalendar for Date<A> {
}
}

impl IsInCalendar for Time {
impl InCalendar for Time {
#[inline]
fn check_any_calendar_kind(&self, _: AnyCalendarKind) -> Result<(), MismatchedCalendarError> {
Ok(())
}
}

impl<C: Calendar, A: AsCalendar<Calendar = C>> IsInCalendar for DateTime<A> {
impl<C: Calendar, A: AsCalendar<Calendar = C>> InCalendar for DateTime<A> {
#[inline]
fn check_any_calendar_kind(
&self,
Expand All @@ -490,41 +490,41 @@ impl<C: Calendar, A: AsCalendar<Calendar = C>> IsInCalendar for DateTime<A> {
}
}

impl<C: Calendar, A: AsCalendar<Calendar = C>, Z> IsInCalendar for CustomZonedDateTime<A, Z> {
impl<C: Calendar, A: AsCalendar<Calendar = C>, Z> InCalendar for CustomZonedDateTime<A, Z> {
#[inline]
fn check_any_calendar_kind(&self, _: AnyCalendarKind) -> Result<(), MismatchedCalendarError> {
Ok(())
}
}

impl IsInCalendar for UtcOffset {
impl InCalendar for UtcOffset {
#[inline]
fn check_any_calendar_kind(&self, _: AnyCalendarKind) -> Result<(), MismatchedCalendarError> {
Ok(())
}
}

impl<O: TimeZoneModel> IsInCalendar for TimeZoneInfo<O> {
impl<O: TimeZoneModel> InCalendar for TimeZoneInfo<O> {
#[inline]
fn check_any_calendar_kind(&self, _: AnyCalendarKind) -> Result<(), MismatchedCalendarError> {
Ok(())
}
}

/// An input associated with a fixed, static calendar.
pub trait IsInFixedCalendar<C> {}
pub trait InFixedCalendar<C> {}

impl<C: Calendar, A: AsCalendar<Calendar = C>> IsInFixedCalendar<C> for Date<A> {}
impl<C: Calendar, A: AsCalendar<Calendar = C>> InFixedCalendar<C> for Date<A> {}

impl<C> IsInFixedCalendar<C> for Time {}
impl<C> InFixedCalendar<C> for Time {}

impl<C: Calendar, A: AsCalendar<Calendar = C>> IsInFixedCalendar<C> for DateTime<A> {}
impl<C: Calendar, A: AsCalendar<Calendar = C>> InFixedCalendar<C> for DateTime<A> {}

impl<C: Calendar, A: AsCalendar<Calendar = C>, Z> IsInFixedCalendar<C>
impl<C: Calendar, A: AsCalendar<Calendar = C>, Z> InFixedCalendar<C>
for CustomZonedDateTime<A, Z>
{
}

impl<C> IsInFixedCalendar<C> for UtcOffset {}
impl<C> InFixedCalendar<C> for UtcOffset {}

impl<C, O: TimeZoneModel> IsInFixedCalendar<C> for TimeZoneInfo<O> {}
impl<C, O: TimeZoneModel> InFixedCalendar<C> for TimeZoneInfo<O> {}
4 changes: 2 additions & 2 deletions components/datetime/src/scaffold/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ pub use calendar::CalMarkers;
pub use calendar::CldrCalendar;
pub use calendar::ConvertCalendar;
pub use calendar::FullDataCalMarkers;
pub use calendar::IsInCalendar;
pub use calendar::IsInFixedCalendar;
pub use calendar::InCalendar;
pub use calendar::InFixedCalendar;
pub use calendar::NoDataCalMarkers;

pub(crate) use fieldset_traits::datetime_marker_helper;
Expand Down

0 comments on commit 0a6da33

Please sign in to comment.