From eccd62582883f5bc25f614fac3b4aa582f1e10b6 Mon Sep 17 00:00:00 2001 From: Peter Todd Date: Mon, 8 May 2017 07:10:51 -0400 Subject: [PATCH] Implement From<[u8;32]> for Message --- src/lib.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index d878500..3791b17 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -302,6 +302,13 @@ impl Message { } } +/// Creates a message from a `MESSAGE_SIZE` byte array +impl From<[u8; constants::MESSAGE_SIZE]> for Message { + fn from(buf: [u8; constants::MESSAGE_SIZE]) -> Message { + Message(buf) + } +} + /// An ECDSA error #[derive(Copy, PartialEq, Eq, Clone, Debug)] pub enum Error {