Skip to content

Commit 5fc187c

Browse files
committed
Fix a link, improve method resolution
1 parent 15cad1c commit 5fc187c

File tree

2 files changed

+27
-24
lines changed

2 files changed

+27
-24
lines changed

library/std/src/net/addr.rs

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ use crate::vec;
2222
/// The size of a `SocketAddr` instance may vary depending on the target operating
2323
/// system.
2424
///
25+
/// [IP address]: IpAddr
26+
///
2527
/// # Examples
2628
///
2729
/// ```

library/std/src/net/ip.rs

+25-24
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,8 @@ pub enum Ipv6MulticastScope {
133133
impl IpAddr {
134134
/// Returns [`true`] for the special 'unspecified' address.
135135
///
136-
/// See the documentation for [`Ipv4Addr::is_unspecified`] and
137-
/// [`Ipv6Addr::is_unspecified`] for more details.
136+
/// See the documentation for [`Ipv4Addr::is_unspecified()`] and
137+
/// [`Ipv6Addr::is_unspecified()`] for more details.
138138
///
139139
/// [`true`]: ../../std/primitive.bool.html
140140
///
@@ -156,8 +156,8 @@ impl IpAddr {
156156

157157
/// Returns [`true`] if this is a loopback address.
158158
///
159-
/// See the documentation for [`Ipv4Addr::is_loopback`] and
160-
/// [`Ipv6Addr::is_loopback`] for more details.
159+
/// See the documentation for [`Ipv4Addr::is_loopback()`] and
160+
/// [`Ipv6Addr::is_loopback()`] for more details.
161161
///
162162
/// [`true`]: ../../std/primitive.bool.html
163163
///
@@ -179,8 +179,8 @@ impl IpAddr {
179179

180180
/// Returns [`true`] if the address appears to be globally routable.
181181
///
182-
/// See the documentation for [`Ipv4Addr::is_global`] and
183-
/// [`Ipv6Addr::is_global`] for more details.
182+
/// See the documentation for [`Ipv4Addr::is_global()`] and
183+
/// [`Ipv6Addr::is_global()`] for more details.
184184
///
185185
/// [`true`]: ../../std/primitive.bool.html
186186
///
@@ -203,8 +203,8 @@ impl IpAddr {
203203

204204
/// Returns [`true`] if this is a multicast address.
205205
///
206-
/// See the documentation for [`Ipv4Addr::is_multicast`] and
207-
/// [`Ipv6Addr::is_multicast`] for more details.
206+
/// See the documentation for [`Ipv4Addr::is_multicast()`] and
207+
/// [`Ipv6Addr::is_multicast()`] for more details.
208208
///
209209
/// [`true`]: ../../std/primitive.bool.html
210210
///
@@ -226,8 +226,8 @@ impl IpAddr {
226226

227227
/// Returns [`true`] if this address is in a range designated for documentation.
228228
///
229-
/// See the documentation for [`Ipv4Addr::is_documentation`] and
230-
/// [`Ipv6Addr::is_documentation`] for more details.
229+
/// See the documentation for [`Ipv4Addr::is_documentation()`] and
230+
/// [`Ipv6Addr::is_documentation()`] for more details.
231231
///
232232
/// [`true`]: ../../std/primitive.bool.html
233233
///
@@ -470,23 +470,24 @@ impl Ipv4Addr {
470470
/// Returns [`true`] if the address appears to be globally routable.
471471
/// See [iana-ipv4-special-registry][ipv4-sr].
472472
///
473-
/// The following return false:
473+
/// The following return [`false`]:
474474
///
475-
/// - private addresses (see [`Ipv4Addr::is_private`])
476-
/// - the loopback address (see [`Ipv4Addr::is_loopback`])
477-
/// - the link-local address (see [`Ipv4Addr::is_link_local`])
478-
/// - the broadcast address (see [`Ipv4Addr::is_broadcast`])
479-
/// - addresses used for documentation (see [`Ipv4Addr::is_documentation`])
480-
/// - the unspecified address (see [`Ipv4Addr::is_unspecified`]), and the whole
475+
/// - private addresses (see [`Ipv4Addr::is_private()`])
476+
/// - the loopback address (see [`Ipv4Addr::is_loopback()`])
477+
/// - the link-local address (see [`Ipv4Addr::is_link_local()`])
478+
/// - the broadcast address (see [`Ipv4Addr::is_broadcast()`])
479+
/// - addresses used for documentation (see [`Ipv4Addr::is_documentation()`])
480+
/// - the unspecified address (see [`Ipv4Addr::is_unspecified()`]), and the whole
481481
/// 0.0.0.0/8 block
482482
/// - addresses reserved for future protocols (see
483-
/// [`Ipv4Addr::is_ietf_protocol_assignment`], except
483+
/// [`Ipv4Addr::is_ietf_protocol_assignment()`], except
484484
/// `192.0.0.9/32` and `192.0.0.10/32` which are globally routable
485-
/// - addresses reserved for future use (see [`Ipv4Addr::is_reserved`]
485+
/// - addresses reserved for future use (see [`Ipv4Addr::is_reserved()`]
486486
/// - addresses reserved for networking devices benchmarking (see
487-
/// [`Ipv4Addr::is_benchmarking`])
487+
/// [`Ipv4Addr::is_benchmarking()`])
488488
///
489489
/// [`true`]: ../../std/primitive.bool.html
490+
/// [`false`]: ../../std/primitive.bool.html
490491
/// [ipv4-sr]: https://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml
491492
///
492493
/// # Examples
@@ -1218,7 +1219,7 @@ impl Ipv6Addr {
12181219
///
12191220
/// This method validates the format defined in the RFC and won't recognize the following
12201221
/// addresses such as `fe80:0:0:1::` or `fe81::` as unicast link-local addresses for example.
1221-
/// If you need a less strict validation use [`Ipv6Addr::is_unicast_link_local`] instead.
1222+
/// If you need a less strict validation use [`Ipv6Addr::is_unicast_link_local()`] instead.
12221223
///
12231224
/// [`true`]: ../../std/primitive.bool.html
12241225
///
@@ -1249,7 +1250,7 @@ impl Ipv6Addr {
12491250
/// - [IETF RFC 4291 section 2.5.6]
12501251
/// - [RFC 4291 errata 4406] (which has been rejected but provides useful
12511252
/// insight)
1252-
/// - [`Ipv6Addr::is_unicast_link_local`]
1253+
/// - [`Ipv6Addr::is_unicast_link_local()`]
12531254
///
12541255
/// [IETF RFC 4291]: https://tools.ietf.org/html/rfc4291
12551256
/// [IETF RFC 4291 section 2.5.6]: https://tools.ietf.org/html/rfc4291#section-2.5.6
@@ -1275,9 +1276,9 @@ impl Ipv6Addr {
12751276
/// ```
12761277
///
12771278
/// As a result, this method consider addresses such as `fe80:0:0:1::` or `fe81::` to be
1278-
/// unicast link-local addresses, whereas [`Ipv6Addr::is_unicast_link_local_strict`] does not.
1279+
/// unicast link-local addresses, whereas [`Ipv6Addr::is_unicast_link_local_strict()`] does not.
12791280
/// If you need a strict validation fully compliant with the RFC, use
1280-
/// [`Ipv6Addr::is_unicast_link_local_strict`] instead.
1281+
/// [`Ipv6Addr::is_unicast_link_local_strict()`] instead.
12811282
///
12821283
/// [`true`]: ../../std/primitive.bool.html
12831284
///

0 commit comments

Comments
 (0)