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.
This commit is contained in:
Alex Mikhalev 2016-11-14 08:53:58 -07:00
parent e93d549c5b
commit cebb2483d9
1 changed files with 1 additions and 1 deletions

View File

@ -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.