Skip to content

Commit

Permalink
Merge pull request #30 from nervosnetwork/quake/peer-id-display
Browse files Browse the repository at this point in the history
chore: add Display impl for PeerId
  • Loading branch information
driftluo authored May 22, 2024
2 parents 339a41b + 6bc3f9e commit 277cd87
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions secio/src/peer_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@ impl fmt::Debug for PeerId {
}
}

impl fmt::Display for PeerId {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.to_base58())
}
}

impl From<PublicKey> for PeerId {
#[inline]
fn from(key: PublicKey) -> PeerId {
Expand Down

0 comments on commit 277cd87

Please sign in to comment.