Skip to content

Commit 277cd87

Browse files
authored
Merge pull request #30 from nervosnetwork/quake/peer-id-display
chore: add Display impl for PeerId
2 parents 339a41b + 6bc3f9e commit 277cd87

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

secio/src/peer_id.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,12 @@ impl fmt::Debug for PeerId {
111111
}
112112
}
113113

114+
impl fmt::Display for PeerId {
115+
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
116+
write!(f, "{}", self.to_base58())
117+
}
118+
}
119+
114120
impl From<PublicKey> for PeerId {
115121
#[inline]
116122
fn from(key: PublicKey) -> PeerId {

0 commit comments

Comments
 (0)