From 287e541812668bbad0b72f27dd75758b18097632 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Thu, 4 Apr 2019 14:36:48 -1000 Subject: [PATCH] Move `AsRef` implementation for `hmac::Tag`. --- src/hmac.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/hmac.rs b/src/hmac.rs index e6905e49d..6940199a8 100644 --- a/src/hmac.rs +++ b/src/hmac.rs @@ -135,6 +135,11 @@ pub type Signature = Tag; #[derive(Clone, Copy, Debug)] pub struct Tag(digest::Digest); +impl AsRef<[u8]> for Tag { + #[inline] + fn as_ref(&self) -> &[u8] { self.0.as_ref() } +} + /// A key to use for HMAC signing. pub struct Key { ctx_prototype: Context, @@ -158,11 +163,6 @@ impl core::fmt::Debug for Key { } } -impl AsRef<[u8]> for Tag { - #[inline] - fn as_ref(&self) -> &[u8] { self.0.as_ref() } -} - impl Key { /// Generate an HMAC signing key using the given digest algorithm with a /// random value generated from `rng`.