From 67fc241d3095bfbb3cde09cd870f925d9936e1bb Mon Sep 17 00:00:00 2001 From: vnprc Date: Wed, 13 Nov 2024 10:33:35 -0500 Subject: [PATCH] remove TryFrom for Id and it's inverse --- crates/cdk/src/nuts/nut02.rs | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/crates/cdk/src/nuts/nut02.rs b/crates/cdk/src/nuts/nut02.rs index 57393980..c01c9b36 100644 --- a/crates/cdk/src/nuts/nut02.rs +++ b/crates/cdk/src/nuts/nut02.rs @@ -126,24 +126,6 @@ impl TryFrom for u32 { } } -impl TryFrom for Id { - type Error = Error; - fn try_from(value: u64) -> Result { - let bytes = value.to_be_bytes(); - Self::from_bytes(&bytes) - } -} - -impl TryFrom for u64 { - type Error = Error; - - fn try_from(value: Id) -> Result { - let bytes = value.to_bytes(); - let byte_array: [u8; 8] = bytes.try_into().map_err(|_| Error::Length)?; - Ok(u64::from_be_bytes(byte_array)) - } -} - impl fmt::Display for Id { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.write_str(&format!("{}{}", self.version, hex::encode(self.id)))