checkpoint

This commit is contained in:
John Smith
2023-04-07 19:58:11 -04:00
parent e46d64f648
commit 777efaff24
10 changed files with 283 additions and 138 deletions

View File

@@ -238,9 +238,9 @@ macro_rules! byte_array_type {
Self::try_decode(value)
}
}
impl TryFrom(&[u8]) for $name {
impl TryFrom<&[u8]> for $name {
type Error = VeilidAPIError;
pub fn try_from(v: &[u8]) -> Result<Self, Self::Error> {
fn try_from(v: &[u8]) -> Result<Self, Self::Error> {
let vl = v.len();
Ok(Self {
bytes: v.try_into().map_err(|_| {