Add AsRef<[u8]> method for Blob (#361)
This commit is contained in:
parent
2f4af2fd8f
commit
fbef59a3f9
|
@ -260,6 +260,12 @@ impl Blob {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl AsRef<[u8]> for Blob {
|
||||||
|
fn as_ref(&self) -> &[u8] {
|
||||||
|
&self.bytes
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl Bytes32 {
|
impl Bytes32 {
|
||||||
pub fn from_bytes(bytes: &[u8]) -> Result<Self, Error> {
|
pub fn from_bytes(bytes: &[u8]) -> Result<Self, Error> {
|
||||||
if bytes.len() != 32 {
|
if bytes.len() != 32 {
|
||||||
|
|
Loading…
Reference in New Issue