Skip to content

Commit 72a1d3a

Browse files
committed
fix: bytes to pubkey conversion
1 parent 99d8a86 commit 72a1d3a

File tree

1 file changed

+8
-6
lines changed
  • rust/rbac-registration/src/cardano/cip509/rbac

1 file changed

+8
-6
lines changed

rust/rbac-registration/src/cardano/cip509/rbac/pub_key.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ impl From<[u8; 32]> for Ed25519PublicKey {
2828
}
2929
}
3030

31-
impl Into<Bytes> for Ed25519PublicKey {
32-
fn into(self) -> Bytes {
33-
let vec: Vec<u8> = self.0.to_vec();
31+
impl From<Ed25519PublicKey> for Bytes {
32+
fn from(val: Ed25519PublicKey) -> Self {
33+
let vec: Vec<u8> = val.0.to_vec();
3434
Bytes::from(vec)
3535
}
3636
}
@@ -56,9 +56,11 @@ impl Decode<'_, ()> for SimplePublicKeyType {
5656
}
5757
},
5858
minicbor::data::Type::Undefined => Ok(Self::Undefined),
59-
_ => Err(decode::Error::message(
60-
"Invalid datatype for SimplePublicKeyType",
61-
)),
59+
_ => {
60+
Err(decode::Error::message(
61+
"Invalid datatype for SimplePublicKeyType",
62+
))
63+
},
6264
}
6365
}
6466
}

0 commit comments

Comments
 (0)