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
This commit is contained in:
Dylan DPC
2021-04-05 13:03:42 +02:00
committed by GitHub
+3
View File
@@ -993,6 +993,7 @@ fn cmp(&self, other: &Ipv4Addr) -> Ordering {
}
impl IntoInner<c::in_addr> for Ipv4Addr {
#[inline]
fn into_inner(self) -> c::in_addr {
self.inner
}
@@ -1800,11 +1801,13 @@ fn cmp(&self, other: &Ipv6Addr) -> Ordering {
}
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 }
}