Skip to content

Commit b307014

Browse files
committed
Link methods in From impls
1 parent 30710c3 commit b307014

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

library/core/src/net/ip_addr.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1120,6 +1120,7 @@ impl Ord for Ipv4Addr {
11201120

11211121
#[stable(feature = "ip_u32", since = "1.1.0")]
11221122
impl From<Ipv4Addr> for u32 {
1123+
/// Uses [`Ipv4Addr::to_bits`] to convert an IPv4 address to a host byte order `u32`.
11231124
#[inline]
11241125
fn from(ip: Ipv4Addr) -> u32 {
11251126
ip.to_bits()
@@ -1128,6 +1129,7 @@ impl From<Ipv4Addr> for u32 {
11281129

11291130
#[stable(feature = "ip_u32", since = "1.1.0")]
11301131
impl From<u32> for Ipv4Addr {
1132+
/// Uses [`Ipv4Addr::from_bits`] to convert a host byte order `u32` into an IPv4 address.
11311133
#[inline]
11321134
fn from(ip: u32) -> Ipv4Addr {
11331135
Ipv4Addr::from_bits(ip)
@@ -1995,13 +1997,15 @@ impl Ord for Ipv6Addr {
19951997

19961998
#[stable(feature = "i128", since = "1.26.0")]
19971999
impl From<Ipv6Addr> for u128 {
2000+
/// Uses [`Ipv6Addr::to_bits`] to convert an IPv6 address to a host byte order `u128`.
19982001
#[inline]
19992002
fn from(ip: Ipv6Addr) -> u128 {
20002003
ip.to_bits()
20012004
}
20022005
}
20032006
#[stable(feature = "i128", since = "1.26.0")]
20042007
impl From<u128> for Ipv6Addr {
2008+
/// Uses [`Ipv6Addr::from_bits`] to convert a host byte order `u128` to an IPv6 address.
20052009
#[inline]
20062010
fn from(ip: u128) -> Ipv6Addr {
20072011
Ipv6Addr::from_bits(ip)

0 commit comments

Comments
 (0)