mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
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:
@@ -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 }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user