diff options
| author | Botahamec <botahamec@outlook.com> | 2021-12-27 17:07:31 -0500 |
|---|---|---|
| committer | Botahamec <botahamec@outlook.com> | 2021-12-27 17:07:31 -0500 |
| commit | 561ec37ecfdb0cca9f3f0bfcab93e923bb9727be (patch) | |
| tree | 7759ab651203dc533a5f1668f48b836bacbbea00 | |
| parent | ae55992cae51223690e5cead065425748529b753 (diff) | |
Removed serde
| -rw-r--r-- | Cargo.toml | 3 | ||||
| -rw-r--r-- | src/month.rs | 3 | ||||
| -rw-r--r-- | src/weekday.rs | 3 | ||||
| -rw-r--r-- | src/year.rs | 8 |
4 files changed, 3 insertions, 14 deletions
@@ -8,5 +8,4 @@ license = "Unlicense" [dependencies] derive_more = "0.99" -thiserror = "1" -serde = { version = "1.0", optional = true, features = ["derive"] }
\ No newline at end of file +thiserror = "1"
\ No newline at end of file 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 /// |
