Skip to content

Commit

Permalink
Into bytes instance for const size array-based wrapper types. (#288)
Browse files Browse the repository at this point in the history
* Into bytes instance for const size array-based wrapper types.

* Into => From.
  • Loading branch information
oskin1 authored Dec 27, 2023
1 parent 8ff0b6d commit 6e423ad
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions crypto/rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,12 @@ macro_rules! impl_hash_type {
}
}

impl From<$name> for [u8; $byte_count] {
fn from($name(bytes): $name) -> Self {
bytes
}
}

impl RawBytesEncoding for $name {
fn to_raw_bytes(&self) -> &[u8] {
self.0.as_ref()
Expand Down

0 comments on commit 6e423ad

Please sign in to comment.