diff --git a/components/calendar/src/types.rs b/components/calendar/src/types.rs index b27e9f43292..bee73d86a4e 100644 --- a/components/calendar/src/types.rs +++ b/components/calendar/src/types.rs @@ -180,7 +180,7 @@ impl FormattingEra { } /// Year information for a year that is specified with an era -#[derive(Copy, Clone, Debug, PartialEq)] +#[derive(Copy, Clone, Debug, PartialEq, Default)] #[non_exhaustive] pub struct EraYear { /// The era code as used in formatting. This era code is not necessarily unique for the calendar, and @@ -202,7 +202,7 @@ pub struct EraYear { } /// Year information for a year that is specified as a cyclic year -#[derive(Copy, Clone, Debug, PartialEq)] +#[derive(Copy, Clone, Debug, PartialEq, Default)] #[non_exhaustive] pub struct CyclicYear { /// The year in the cycle. @@ -316,7 +316,7 @@ impl fmt::Display for MonthCode { /// Representation of a formattable month. #[derive(Copy, Clone, Debug, PartialEq)] -#[allow(clippy::exhaustive_structs)] // this type is stable +#[non_exhaustive] pub struct MonthInfo { /// The month number in this given year. For calendars with leap months, all months after /// the leap month will end up with an incremented number. @@ -355,9 +355,10 @@ impl MonthInfo { self.standard_code.parsed().map(|(_, l)| l).unwrap_or(false) } } + /// A struct containing various details about the position of the day within a year. It is returned -// by the [`day_of_year_info()`](trait.DateInput.html#tymethod.day_of_year_info) method of the -// [`DateInput`] trait. +/// by the [`day_of_year_info()`](trait.DateInput.html#tymethod.day_of_year_info) method of the +/// [`DateInput`] trait. #[derive(Copy, Clone, Debug, PartialEq)] #[allow(clippy::exhaustive_structs)] // this type is stable pub struct DayOfYearInfo {