Skip to content

Commit

Permalink
Add #[inline] to IpAddr methods
Browse files Browse the repository at this point in the history
Add some inlines to trivial methods of IpAddr
Closes rust-lang#77583
  • Loading branch information
AngelicosPhosphoros committed Apr 3, 2021
1 parent 836c317 commit a3d0fa8
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 a3d0fa8

Please sign in to comment.