From db718fe75a30685a51bd4d2321a5327ab0c408ac Mon Sep 17 00:00:00 2001 From: KAMADA Ken'ichi Date: Tue, 11 Jul 2017 23:29:26 +0900 Subject: [PATCH] Derive Hash trait for Tag and Context. --- src/tag.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tag.rs b/src/tag.rs index 3b0f246..c57f2bb 100644 --- a/src/tag.rs +++ b/src/tag.rs @@ -47,7 +47,7 @@ use util::atou16; // PartialEq and Eq need to be _automatically derived_ for Tag to // emulate structural equivalency. // -#[derive(Debug, Copy, Clone, PartialEq, Eq)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub struct Tag(pub Context, pub u16); impl Tag { @@ -94,7 +94,7 @@ impl fmt::Display for Tag { } /// An enum that indicates how a tag number is interpreted. -#[derive(Debug, Copy, Clone, PartialEq, Eq)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub enum Context { /// TIFF attributes defined in the TIFF Rev. 6.0 specification. Tiff, // 0th/1st IFD