From c9ccdc343a2d3561c014046e8b8b0c3791601518 Mon Sep 17 00:00:00 2001 From: KAMADA Ken'ichi Date: Wed, 15 Mar 2017 23:42:14 +0900 Subject: [PATCH] Derive Copy and Clone traits for Tag for future APIs. --- src/tag.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tag.rs b/src/tag.rs index a88bb9f..dc253dd 100644 --- a/src/tag.rs +++ b/src/tag.rs @@ -43,19 +43,19 @@ use std::fmt; // PartialEq and Eq need to be _automatically derived_ for Tag to // emulate structural equivalency. // -#[derive(Debug, PartialEq, Eq)] +#[derive(Debug, Copy, Clone, PartialEq, Eq)] pub struct Tag(pub Context, pub u16); impl Tag { /// Returns the context of the tag. #[inline] - pub fn context(&self) -> Context { + pub fn context(self) -> Context { self.0 } /// Returns the value of the tag. #[inline] - pub fn value(&self) -> u16 { + pub fn value(self) -> u16 { self.1 }