From cebb2483d97e8a2fa126e68935e5243a638e9afa Mon Sep 17 00:00:00 2001 From: Alex Mikhalev Date: Mon, 14 Nov 2016 08:53:58 -0700 Subject: [PATCH] Added #[derive(Hash)] for Weekday enum This is so it can at least be used in a HashSet, if not in a BTreeSet because it does not impl Ord. --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index ad35171..7f2bb0b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -384,7 +384,7 @@ pub mod format; /// The order of the days of week depends on the context. /// (This is why this type does *not* implement `PartialOrd` or `Ord` traits.) /// One should prefer `*_from_monday` or `*_from_sunday` methods to get the correct result. -#[derive(PartialEq, Eq, Copy, Clone, Debug)] +#[derive(PartialEq, Eq, Copy, Clone, Debug, Hash)] #[cfg_attr(feature = "rustc-serialize", derive(RustcEncodable, RustcDecodable))] pub enum Weekday { /// Monday.