From 75d90a56fa6ebbb5a173639ed3d9c841058a4905 Mon Sep 17 00:00:00 2001 From: Kang Seonghoon Date: Sun, 1 Jun 2014 01:36:59 +0900 Subject: [PATCH] language changes: {,Total}{Eq,Ord} -> {Partial,}{Eq,Ord}. --- src/chrono/date.rs | 10 +++++----- src/chrono/datetime.rs | 2 +- src/chrono/duration.rs | 2 +- src/chrono/time.rs | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/chrono/date.rs b/src/chrono/date.rs index a36c73f..3908417 100644 --- a/src/chrono/date.rs +++ b/src/chrono/date.rs @@ -16,7 +16,7 @@ pub static MAX_YEAR: int = internals::MAX_YEAR as int; pub static MIN_YEAR: int = internals::MIN_YEAR as int; /// The day of week (DOW). -#[deriving(Eq, TotalEq, FromPrimitive, Show)] +#[deriving(PartialEq, Eq, FromPrimitive, Show)] pub enum Weekday { Mon = 0, Tue = 1, @@ -208,7 +208,7 @@ pub trait Datelike { /// ISO 8601 calendar date without timezone. /// Allows for every proleptic Gregorian date from Jan 1, 262145 BCE to Dec 31, 262143 CE. /// Also supports the conversion from ISO 8601 ordinal and week date. -#[deriving(Eq, TotalEq, Ord, TotalOrd, Hash)] +#[deriving(PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct DateZ { ymdf: DateImpl, // (year << 13) | of } @@ -740,7 +740,7 @@ mod internals { /// where `a` is `1` for the common year (simplifies the `Of` validation) /// and `bbb` is a non-zero `Weekday` (mapping `Mon` to 7) of the last day in the past year /// (simplifies the day of week calculation from the 1-based ordinal). - #[deriving(Eq, TotalEq)] + #[deriving(PartialEq, Eq)] pub struct YearFlags(pub u8); pub static A: YearFlags = YearFlags(0o15); pub static AG: YearFlags = YearFlags(0o05); @@ -980,7 +980,7 @@ mod internals { /// /// The whole bits except for the least 3 bits are referred as `Ol` (ordinal and leap flag), /// which is an index to the `OL_TO_MDL` lookup table. - #[deriving(Eq, Ord)] + #[deriving(PartialEq, PartialOrd)] pub struct Of(pub uint); impl Of { @@ -1081,7 +1081,7 @@ mod internals { /// The whole bits except for the least 3 bits are referred as `Mdl` /// (month, day of month and leap flag), /// which is an index to the `MDL_TO_OL` lookup table. - #[deriving(Eq, Ord)] + #[deriving(PartialEq, PartialOrd)] pub struct Mdf(pub uint); impl Mdf { diff --git a/src/chrono/datetime.rs b/src/chrono/datetime.rs index de7a169..2f6d1b7 100644 --- a/src/chrono/datetime.rs +++ b/src/chrono/datetime.rs @@ -11,7 +11,7 @@ use duration::Duration; use time::{Timelike, TimeZ}; use date::{Datelike, DateZ, Weekday}; -#[deriving(Eq, TotalEq, Ord, TotalOrd, Hash)] +#[deriving(PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct DateTimeZ { date: DateZ, time: TimeZ, diff --git a/src/chrono/duration.rs b/src/chrono/duration.rs index 478b11b..b0c7a28 100644 --- a/src/chrono/duration.rs +++ b/src/chrono/duration.rs @@ -19,7 +19,7 @@ macro_rules! earlyexit( ($e:expr) => (match $e { Some(v) => v, None => return None }) ) -#[deriving(Eq, TotalEq, Ord, TotalOrd)] +#[deriving(PartialEq, Eq, PartialOrd, Ord)] pub struct Duration { days: i32, secs: u32, diff --git a/src/chrono/time.rs b/src/chrono/time.rs index 42c8157..d560e57 100644 --- a/src/chrono/time.rs +++ b/src/chrono/time.rs @@ -63,7 +63,7 @@ pub trait Timelike { /// ISO 8601 time without timezone. /// Allows for the nanosecond precision and optional leap second representation. -#[deriving(Eq, TotalEq, Ord, TotalOrd, Hash)] +#[deriving(PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct TimeZ { hour: u8, min: u8,