Skip to content

Commit

Permalink
Backported serde build fix in libp2p#1912 to multiadd 0.7.3
Browse files Browse the repository at this point in the history
In serde 1.0.119, the export module is no longer public which breaks the build.
  • Loading branch information
sdbondi committed Jan 13, 2021
1 parent 2c40f28 commit b92ec7a
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions misc/multiaddr/src/onion_addr.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
use std::borrow::Cow;
use std::fmt::Debug;
use serde::export::Formatter;
use std::fmt;
use std::{borrow::Cow, fmt};

/// Represents an Onion v3 address
#[derive(Clone)]
Expand Down Expand Up @@ -30,7 +27,7 @@ impl PartialEq for Onion3Addr<'_> {
}
}

impl Eq for Onion3Addr<'_> { }
impl Eq for Onion3Addr<'_> {}

impl From<([u8; 35], u16)> for Onion3Addr<'_> {
fn from(parts: ([u8; 35], u16)) -> Self {
Expand All @@ -44,11 +41,11 @@ impl<'a> From<(&'a [u8; 35], u16)> for Onion3Addr<'a> {
}
}

impl Debug for Onion3Addr<'_> {
fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), fmt::Error> {
f.debug_tuple("Onion3Addr")
.field(&format!("{:02x?}", &self.0[..]))
.field(&self.1)
.finish()
impl fmt::Debug for Onion3Addr<'_> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> {
f.debug_tuple("Onion3Addr")
.field(&format!("{:02x?}", &self.0[..]))
.field(&self.1)
.finish()
}
}

0 comments on commit b92ec7a

Please sign in to comment.