Change 'inner' field name to 'fd'/'socket' on Unix/Windows in Debug impls
This commit is contained in:
parent
dd85c42ee1
commit
91f9dd468f
@ -281,7 +281,8 @@ impl fmt::Debug for TcpStream {
|
||||
res = res.field("peer", &peer);
|
||||
}
|
||||
|
||||
res = res.field("inner", &self.inner.as_inner());
|
||||
let name = if cfg!(windows) {"socket"} else {"fd"};
|
||||
res = res.field(name, &self.inner.as_inner());
|
||||
res.finish()
|
||||
}
|
||||
}
|
||||
@ -353,7 +354,8 @@ impl fmt::Debug for TcpListener {
|
||||
res = res.field("addr", &addr);
|
||||
}
|
||||
|
||||
res = res.field("inner", &self.inner.as_inner());
|
||||
let name = if cfg!(windows) {"socket"} else {"fd"};
|
||||
res = res.field(name, &self.inner.as_inner());
|
||||
res.finish()
|
||||
}
|
||||
}
|
||||
@ -485,7 +487,8 @@ impl fmt::Debug for UdpSocket {
|
||||
res = res.field("addr", &addr);
|
||||
}
|
||||
|
||||
res = res.field("inner", &self.inner.as_inner());
|
||||
let name = if cfg!(windows) {"socket"} else {"fd"};
|
||||
res = res.field(name, &self.inner.as_inner());
|
||||
res.finish()
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user