Skip to content

Commit

Permalink
Calendar Ord follow-ups (#3470)
Browse files Browse the repository at this point in the history
  • Loading branch information
sffc authored Jun 6, 2023
1 parent a7785a0 commit 5c2ea06
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion components/calendar/src/any_calendar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,9 @@ pub enum AnyCalendar {
Iso(Iso),
}

// TODO(#3469): Decide on the best way to implement Ord.
/// The inner date type for [`AnyCalendar`]
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Debug)]
#[derive(Clone, PartialEq, Eq, Debug)]
#[non_exhaustive]
pub enum AnyDateInner {
/// A date for a [`Gregorian`] calendar
Expand Down
1 change: 1 addition & 0 deletions components/calendar/src/calendar_arithmetic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use core::convert::TryInto;
use core::marker::PhantomData;
use tinystr::tinystr;

// Note: The Ord/PartialOrd impls can be derived because the fields are in the correct order.
#[derive(Copy, Clone, Debug, Hash, Eq, PartialEq, Ord, PartialOrd)]
#[allow(clippy::exhaustive_structs)] // this type is stable
pub struct ArithmeticDate<C: CalendarArithmetic> {
Expand Down

0 comments on commit 5c2ea06

Please sign in to comment.