Implement From<[u8;32]> for Message

This commit is contained in:
Peter Todd 2017-05-08 07:10:51 -04:00
parent 70f54e1dea
commit eccd625828
No known key found for this signature in database
GPG Key ID: 2481403DA5F091FB
1 changed files with 7 additions and 0 deletions

View File

@ -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 /// An ECDSA error
#[derive(Copy, PartialEq, Eq, Clone, Debug)] #[derive(Copy, PartialEq, Eq, Clone, Debug)]
pub enum Error { pub enum Error {