From 66f0d8ee39cecf1a09f324d4227ae4d74ad9119e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Ml=C3=A1dek?= Date: Tue, 1 Aug 2023 21:59:23 +0200 Subject: [PATCH] chore: remove unnecessary std::, reformat --- base/src/addressing.rs | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/base/src/addressing.rs b/base/src/addressing.rs index e7e4a81..aafb4ac 100644 --- a/base/src/addressing.rs +++ b/base/src/addressing.rs @@ -46,7 +46,7 @@ pub type UpCid = cid::CidGeneric<256>; impl Address { pub fn encode(&self) -> Result, UpEndError> { let (codec, hash) = match self { - Self::Hash(hash) => (RAW, LargeMultihash::from(hash)), + Self::Hash(hash) => (RAW, hash.into()), Self::Uuid(uuid) => ( UP_UUID, LargeMultihash::wrap(IDENTITY, uuid.as_bytes()).map_err(UpEndError::from_any)?, @@ -205,18 +205,14 @@ impl FromStr for Address { } } -impl std::fmt::Display for Address { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!( - f, - "{}", - b58_encode(self.encode().map_err(|_| std::fmt::Error)?) - ) +impl fmt::Display for Address { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "{}", b58_encode(self.encode().map_err(|_| fmt::Error)?)) } } -impl std::fmt::Debug for Address { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { +impl fmt::Debug for Address { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!( f, "Address<{}>: {}",