diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/month.rs | 3 | ||||
| -rw-r--r-- | src/weekday.rs | 3 | ||||
| -rw-r--r-- | src/year.rs | 8 |
3 files changed, 2 insertions, 12 deletions
diff --git a/src/month.rs b/src/month.rs index 66360ef..ebb95e1 100644 --- a/src/month.rs +++ b/src/month.rs @@ -1,7 +1,5 @@ use derive_more::Display; -#[cfg(feature = "serde")] -use serde::{Deserialize, Serialize}; use thiserror::Error; use self::Month::*; @@ -10,7 +8,6 @@ use core::str::FromStr; /// Months of the year #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug, Display)] -#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[repr(u8)] pub enum Month { January = 1, diff --git a/src/weekday.rs b/src/weekday.rs index 5679bc7..b5e3f32 100644 --- a/src/weekday.rs +++ b/src/weekday.rs @@ -2,15 +2,12 @@ use std::str::FromStr; use derive_more::Display; -#[cfg(feature = "serde")] -use serde::{Deserialize, Serialize}; use thiserror::Error; use self::Weekday::*; /// Day of the week #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug, Display)] -#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[repr(u8)] pub enum Weekday { Monday = 0, diff --git a/src/year.rs b/src/year.rs index 3b4fad9..22627dd 100644 --- a/src/year.rs +++ b/src/year.rs @@ -2,20 +2,16 @@ use core::ops::{Add, AddAssign, Sub, SubAssign}; use derive_more::{Display, FromStr}; -#[cfg(feature = "serde")] -use serde::{Deserialize, Serialize}; - /// A year value type, stored as an i32 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug, FromStr, Display)] -#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct Year(i32); impl Year { /// The latest year that can be represented - pub const MAX: Year = Year(i32::MAX); + pub const MAX: Self = Self(i32::MAX); /// The earliest year that can be represented - pub const MIN: Year = Year(i32::MIN); + pub const MIN: Self = Self(i32::MIN); /// An equivalent of `Year::from(i32)`, which can be run at compile-time /// |
