Skip to content

Commit

Permalink
Reintroduce derives and exhaustive
Browse files Browse the repository at this point in the history
  • Loading branch information
Manishearth committed Apr 19, 2024
1 parent 226aa13 commit 7003831
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions components/calendar/src/any_calendar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1234,7 +1234,7 @@ impl IntoAnyCalendar for IslamicCivil {
AnyCalendar::IslamicCivil(self)
}
fn to_any_cloned(&self) -> AnyCalendar {
AnyCalendar::IslamicCivil(self.clone())
AnyCalendar::IslamicCivil(self)
}
fn date_to_any(&self, d: &Self::DateInner) -> AnyDateInner {
AnyDateInner::IslamicCivil(*d)
Expand All @@ -1258,7 +1258,7 @@ impl IntoAnyCalendar for IslamicTabular {
AnyCalendar::IslamicTabular(self)
}
fn to_any_cloned(&self) -> AnyCalendar {
AnyCalendar::IslamicTabular(self.clone())
AnyCalendar::IslamicTabular(self)
}
fn date_to_any(&self, d: &Self::DateInner) -> AnyDateInner {
AnyDateInner::IslamicTabular(*d)
Expand Down
6 changes: 4 additions & 2 deletions components/calendar/src/islamic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ pub struct IslamicObservational {
///
/// This calendar is a pure lunar calendar with no leap months. It uses month codes
/// `"M01" - "M12"`.
#[derive(Clone, Debug, Default)]
#[derive(Copy, Clone, Debug, Default, Hash, Eq, PartialEq, PartialOrd, Ord)]
#[allow(clippy::exhaustive_structs)] // unit struct
pub struct IslamicCivil;

/// Umm al-Qura Hijri Calendar (Used in Saudi Arabia)
Expand Down Expand Up @@ -107,7 +108,8 @@ pub struct IslamicUmmAlQura {
///
/// This calendar is a pure lunar calendar with no leap months. It uses month codes
/// `"M01" - "M12"`.
#[derive(Clone, Debug, Default)]
#[derive(Copy, Clone, Debug, Default, Hash, Eq, PartialEq, PartialOrd, Ord)]
#[allow(clippy::exhaustive_structs)] // unit struct
pub struct IslamicTabular;

impl IslamicObservational {
Expand Down

0 comments on commit 7003831

Please sign in to comment.