mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-10 08:31:20 +00:00
Improve Debug and Display for PeerId (#1019)
* Improve Debug and Display for PeerId * Update core/src/peer_id.rs Co-Authored-By: tomaka <pierre.krieger1708@gmail.com>
This commit is contained in:
parent
34db72a080
commit
538c3dffdf
@ -35,7 +35,15 @@ pub struct PeerId {
|
||||
|
||||
impl fmt::Debug for PeerId {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
write!(f, "PeerId({})", self.to_base58())
|
||||
f.debug_tuple("PeerId")
|
||||
.field(&self.to_base58())
|
||||
.finish()
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for PeerId {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
self.to_base58().fmt(f)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user