diff options
| author | Dylan DPC <dylan.dpc@gmail.com> | 2021-04-05 13:03:42 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-05 13:03:42 +0200 |
| commit | 445aa40153b305cc2017c2ca05010193c2e7b5be (patch) | |
| tree | e6c164ea1de23c070fe52ea698caf0c609b0dc28 | |
| parent | d60cf78fbe2961ab78ff33740fc6cae379804421 (diff) | |
| parent | a3d0fa8008c75c543c37d6f5af6414ae83874974 (diff) | |
| download | rust-445aa40153b305cc2017c2ca05010193c2e7b5be.tar.gz rust-445aa40153b305cc2017c2ca05010193c2e7b5be.zip | |
Rollup merge of #83831 - AngelicosPhosphoros:issue-77583-inline-for-ip, r=m-ou-se
Add `#[inline]` to IpAddr methods Add some inlines to trivial methods of IpAddr Closes https://github.com/rust-lang/rust/issues/77583
| -rw-r--r-- | library/std/src/net/ip.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/library/std/src/net/ip.rs b/library/std/src/net/ip.rs index 7f8c33dac56..da2415e3610 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<c::in_addr> for Ipv4Addr { + #[inline] fn into_inner(self) -> c::in_addr { self.inner } @@ -1800,11 +1801,13 @@ impl Ord for Ipv6Addr { } impl AsInner<c::in6_addr> for Ipv6Addr { + #[inline] fn as_inner(&self) -> &c::in6_addr { &self.inner } } impl FromInner<c::in6_addr> for Ipv6Addr { + #[inline] fn from_inner(addr: c::in6_addr) -> Ipv6Addr { Ipv6Addr { inner: addr } } |
