From 91f9dd468fe3248d215620db00ecc739e67ae964 Mon Sep 17 00:00:00 2001 From: Nick Hamann Date: Sun, 3 May 2015 17:31:26 -0500 Subject: [PATCH] Change 'inner' field name to 'fd'/'socket' on Unix/Windows in Debug impls --- src/libstd/sys/common/net2.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/libstd/sys/common/net2.rs b/src/libstd/sys/common/net2.rs index 688d0edcff1..7da7071670a 100644 --- a/src/libstd/sys/common/net2.rs +++ b/src/libstd/sys/common/net2.rs @@ -281,7 +281,8 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 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 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 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 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 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() } }