feat: impl AsRef for Bytes32 and Bytes48 (#411)
This commit is contained in:
parent
f345b66f53
commit
6164f277d9
|
@ -508,12 +508,24 @@ impl From<[u8; 32]> for Bytes32 {
|
|||
}
|
||||
}
|
||||
|
||||
impl AsRef<[u8; 32]> for Bytes32 {
|
||||
fn as_ref(&self) -> &[u8; 32] {
|
||||
&self.bytes
|
||||
}
|
||||
}
|
||||
|
||||
impl From<[u8; 48]> for Bytes48 {
|
||||
fn from(value: [u8; 48]) -> Self {
|
||||
Self { bytes: value }
|
||||
}
|
||||
}
|
||||
|
||||
impl AsRef<[u8; 48]> for Bytes48 {
|
||||
fn as_ref(&self) -> &[u8; 48] {
|
||||
&self.bytes
|
||||
}
|
||||
}
|
||||
|
||||
impl Deref for Bytes32 {
|
||||
type Target = [u8; 32];
|
||||
fn deref(&self) -> &Self::Target {
|
||||
|
|
Loading…
Reference in New Issue