chore: remove unnecessary std::, reformat
parent
8625b7f519
commit
66f0d8ee39
|
@ -46,7 +46,7 @@ pub type UpCid = cid::CidGeneric<256>;
|
|||
impl Address {
|
||||
pub fn encode(&self) -> Result<Vec<u8>, 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<{}>: {}",
|
||||
|
|
Loading…
Reference in New Issue