From a3d0fa8008c75c543c37d6f5af6414ae83874974 Mon Sep 17 00:00:00 2001 From: AngelicosPhosphoros Date: Sun, 4 Apr 2021 02:42:56 +0300 Subject: [PATCH] Add `#[inline]` to IpAddr methods Add some inlines to trivial methods of IpAddr Closes https://github.com/rust-lang/rust/issues/77583 --- library/std/src/net/ip.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/library/std/src/net/ip.rs b/library/std/src/net/ip.rs index 7f8c33dac561f..da2415e361077 100644 --- a/library/std/src/net/ip.rs +++ b/library/std/src/net/ip.rs @@ -993,6 +993,7 @@ impl Ord for Ipv4Addr { } impl IntoInner for Ipv4Addr { + #[inline] fn into_inner(self) -> c::in_addr { self.inner } @@ -1800,11 +1801,13 @@ impl Ord for Ipv6Addr { } impl AsInner for Ipv6Addr { + #[inline] fn as_inner(&self) -> &c::in6_addr { &self.inner } } impl FromInner for Ipv6Addr { + #[inline] fn from_inner(addr: c::in6_addr) -> Ipv6Addr { Ipv6Addr { inner: addr } }