Shorten debug for PexPeerInfo
This commit is contained in:
parent
9d1ef5c35c
commit
9b5c69f378
1 changed files with 10 additions and 1 deletions
|
|
@ -6,12 +6,21 @@ use clone_to_owned::CloneToOwned;
|
|||
use itertools::{EitherOrBoth, Itertools};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct PexPeerInfo {
|
||||
pub flags: u8,
|
||||
pub addr: SocketAddr,
|
||||
}
|
||||
|
||||
impl core::fmt::Debug for PexPeerInfo {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
write!(f, "{}", self.addr)?;
|
||||
if self.flags != 0 {
|
||||
write!(f, ";flags={}", self.flags)?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Serialize, Default, Deserialize)]
|
||||
pub struct UtPex<B> {
|
||||
added: B,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue