From 3abc30719e588745c8a9190a9842263cd2bfc463 Mon Sep 17 00:00:00 2001 From: Konrad Borowski Date: Mon, 1 May 2023 13:27:02 +0200 Subject: [PATCH] Inline socket function implementations --- library/std/src/sys/unix/l4re.rs | 3 +++ library/std/src/sys/wasi/net.rs | 3 +++ library/std/src/sys_common/net.rs | 3 +++ 3 files changed, 9 insertions(+) diff --git a/library/std/src/sys/unix/l4re.rs b/library/std/src/sys/unix/l4re.rs index 640cd96456c..d77a7ee87da 100644 --- a/library/std/src/sys/unix/l4re.rs +++ b/library/std/src/sys/unix/l4re.rs @@ -184,6 +184,7 @@ pub fn connect_timeout(_: &SocketAddr, _: Duration) -> io::Result { unimpl!(); } + #[inline] pub fn socket(&self) -> &Socket { &self.inner } @@ -306,6 +307,7 @@ pub fn bind(_: io::Result<&SocketAddr>) -> io::Result { unimpl!(); } + #[inline] pub fn socket(&self) -> &Socket { &self.inner } @@ -372,6 +374,7 @@ pub fn bind(_: io::Result<&SocketAddr>) -> io::Result { unimpl!(); } + #[inline] pub fn socket(&self) -> &Socket { &self.inner } diff --git a/library/std/src/sys/wasi/net.rs b/library/std/src/sys/wasi/net.rs index fc78cfcc17c..a5e0f9ee8ba 100644 --- a/library/std/src/sys/wasi/net.rs +++ b/library/std/src/sys/wasi/net.rs @@ -185,6 +185,7 @@ pub fn set_nonblocking(&self, state: bool) -> io::Result<()> { } } + #[inline] pub fn socket(&self) -> &Socket { &self.inner } @@ -275,6 +276,7 @@ pub fn set_nonblocking(&self, state: bool) -> io::Result<()> { } } + #[inline] pub fn socket(&self) -> &Socket { &self.inner } @@ -438,6 +440,7 @@ pub fn connect(&self, _: io::Result<&SocketAddr>) -> io::Result<()> { unsupported() } + #[inline] pub fn socket(&self) -> &Socket { &self.inner } diff --git a/library/std/src/sys_common/net.rs b/library/std/src/sys_common/net.rs index a8deb885069..652c695fc57 100644 --- a/library/std/src/sys_common/net.rs +++ b/library/std/src/sys_common/net.rs @@ -239,6 +239,7 @@ pub fn connect_timeout(addr: &SocketAddr, timeout: Duration) -> io::Result &Socket { &self.inner } @@ -428,6 +429,7 @@ pub fn bind(addr: io::Result<&SocketAddr>) -> io::Result { Ok(TcpListener { inner: sock }) } + #[inline] pub fn socket(&self) -> &Socket { &self.inner } @@ -518,6 +520,7 @@ pub fn bind(addr: io::Result<&SocketAddr>) -> io::Result { Ok(UdpSocket { inner: sock }) } + #[inline] pub fn socket(&self) -> &Socket { &self.inner }