Skip to content

Commit

Permalink
Rollup merge of rust-lang#83831 - AngelicosPhosphoros:issue-77583-inl…
Browse files Browse the repository at this point in the history
…ine-for-ip, r=m-ou-se

Add `#[inline]` to IpAddr methods

Add some inlines to trivial methods of IpAddr
Closes rust-lang#77583
  • Loading branch information
Dylan-DPC authored Apr 5, 2021
2 parents b706a07 + a3d0fa8 commit f4f23fc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions library/std/src/net/ip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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 }
}
Expand Down

0 comments on commit f4f23fc

Please sign in to comment.