Change 'inner' field name to 'fd'/'socket' on Unix/Windows in Debug impls

This commit is contained in:
Nick Hamann 2015-05-03 17:31:26 -05:00
parent dd85c42ee1
commit 91f9dd468f

View File

@ -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()
}
}