File tree Expand file tree Collapse file tree 1 file changed +13
-8
lines changed
crates/libtortillas/src/peer Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -409,19 +409,24 @@ impl From<Hash<20>> for PeerId {
409409impl fmt:: Display for PeerId {
410410 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
411411 if let Some ( version) = self . version ( ) {
412- write ! (
413- f,
414- "{} {} ({})" ,
415- self . client_name( ) ,
416- version,
417- String :: from_utf8_lossy( self . id( ) )
418- )
412+ write ! ( f, "{} {}" , self . client_name( ) , version)
419413 } else {
420- write ! ( f, "{} ({}) " , self . client_name( ) , hex :: encode ( self . id ( ) ) )
414+ write ! ( f, "{}" , self . client_name( ) )
421415 }
422416 }
423417}
424418
419+ impl fmt:: Debug for PeerId {
420+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
421+ write ! (
422+ f,
423+ "{} ({})" ,
424+ self . client_name( ) ,
425+ String :: from_utf8_lossy( self . id( ) )
426+ )
427+ }
428+ }
429+
425430impl FromStr for PeerId {
426431 type Err = std:: array:: TryFromSliceError ;
427432
You can’t perform that action at this time.
0 commit comments