Skip to content

Commit 27acb5c

Browse files
Add missing urls and improve internal doc representation
1 parent 478c0d1 commit 27acb5c

File tree

2 files changed

+21
-6
lines changed

2 files changed

+21
-6
lines changed

src/libstd/net/ip.rs

+19-5
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,9 @@ impl Ipv4Addr {
176176
/// Returns true for the special 'unspecified' address (0.0.0.0).
177177
///
178178
/// This property is defined in _UNIX Network Programming, Second Edition_,
179-
/// W. Richard Stevens, p. 891; see also [ip7]
180-
/// [ip7][http://man7.org/linux/man-pages/man7/ip.7.html]
179+
/// W. Richard Stevens, p. 891; see also [ip7].
180+
///
181+
/// [ip7]: (http://man7.org/linux/man-pages/man7/ip.7.html)
181182
#[stable(feature = "ip_shared", since = "1.12.0")]
182183
pub fn is_unspecified(&self) -> bool {
183184
self.inner.s_addr == 0
@@ -186,6 +187,7 @@ impl Ipv4Addr {
186187
/// Returns true if this is a loopback address (127.0.0.0/8).
187188
///
188189
/// This property is defined by [RFC 1122].
190+
///
189191
/// [RFC 1122]: https://tools.ietf.org/html/rfc1122
190192
#[stable(since = "1.7.0", feature = "ip_17")]
191193
pub fn is_loopback(&self) -> bool {
@@ -195,11 +197,12 @@ impl Ipv4Addr {
195197
/// Returns true if this is a private address.
196198
///
197199
/// The private address ranges are defined in [RFC 1918] and include:
198-
/// [RFC 1918]: https://tools.ietf.org/html/rfc1918
199200
///
200201
/// - 10.0.0.0/8
201202
/// - 172.16.0.0/12
202203
/// - 192.168.0.0/16
204+
///
205+
/// [RFC 1918]: https://tools.ietf.org/html/rfc1918
203206
#[stable(since = "1.7.0", feature = "ip_17")]
204207
pub fn is_private(&self) -> bool {
205208
match (self.octets()[0], self.octets()[1]) {
@@ -213,6 +216,7 @@ impl Ipv4Addr {
213216
/// Returns true if the address is link-local (169.254.0.0/16).
214217
///
215218
/// This property is defined by [RFC 3927].
219+
///
216220
/// [RFC 3927]: https://tools.ietf.org/html/rfc3927
217221
#[stable(since = "1.7.0", feature = "ip_17")]
218222
pub fn is_link_local(&self) -> bool {
@@ -221,7 +225,6 @@ impl Ipv4Addr {
221225

222226
/// Returns true if the address appears to be globally routable.
223227
/// See [iana-ipv4-special-registry][ipv4-sr].
224-
/// [ipv4-sr]: http://goo.gl/RaZ7lg
225228
///
226229
/// The following return false:
227230
///
@@ -231,6 +234,8 @@ impl Ipv4Addr {
231234
/// - the broadcast address (255.255.255.255/32)
232235
/// - test addresses used for documentation (192.0.2.0/24, 198.51.100.0/24 and 203.0.113.0/24)
233236
/// - the unspecified address (0.0.0.0)
237+
///
238+
/// [ipv4-sr]: http://goo.gl/RaZ7lg
234239
pub fn is_global(&self) -> bool {
235240
!self.is_private() && !self.is_loopback() && !self.is_link_local() &&
236241
!self.is_broadcast() && !self.is_documentation() && !self.is_unspecified()
@@ -240,6 +245,7 @@ impl Ipv4Addr {
240245
///
241246
/// Multicast addresses have a most significant octet between 224 and 239,
242247
/// and is defined by [RFC 5771].
248+
///
243249
/// [RFC 5771]: https://tools.ietf.org/html/rfc5771
244250
#[stable(since = "1.7.0", feature = "ip_17")]
245251
pub fn is_multicast(&self) -> bool {
@@ -249,6 +255,7 @@ impl Ipv4Addr {
249255
/// Returns true if this is a broadcast address (255.255.255.255).
250256
///
251257
/// A broadcast address has all octets set to 255 as defined in [RFC 919].
258+
///
252259
/// [RFC 919]: https://tools.ietf.org/html/rfc919
253260
#[stable(since = "1.7.0", feature = "ip_17")]
254261
pub fn is_broadcast(&self) -> bool {
@@ -259,11 +266,12 @@ impl Ipv4Addr {
259266
/// Returns true if this address is in a range designated for documentation.
260267
///
261268
/// This is defined in [RFC 5737]:
262-
/// [RFC 5737]: https://tools.ietf.org/html/rfc5737
263269
///
264270
/// - 192.0.2.0/24 (TEST-NET-1)
265271
/// - 198.51.100.0/24 (TEST-NET-2)
266272
/// - 203.0.113.0/24 (TEST-NET-3)
273+
///
274+
/// [RFC 5737]: https://tools.ietf.org/html/rfc5737
267275
#[stable(since = "1.7.0", feature = "ip_17")]
268276
pub fn is_documentation(&self) -> bool {
269277
match(self.octets()[0], self.octets()[1], self.octets()[2], self.octets()[3]) {
@@ -425,6 +433,7 @@ impl Ipv6Addr {
425433
/// Returns true for the special 'unspecified' address (::).
426434
///
427435
/// This property is defined in [RFC 4291].
436+
///
428437
/// [RFC 4291]: https://tools.ietf.org/html/rfc4291
429438
#[stable(since = "1.7.0", feature = "ip_17")]
430439
pub fn is_unspecified(&self) -> bool {
@@ -434,6 +443,7 @@ impl Ipv6Addr {
434443
/// Returns true if this is a loopback address (::1).
435444
///
436445
/// This property is defined in [RFC 4291].
446+
///
437447
/// [RFC 4291]: https://tools.ietf.org/html/rfc4291
438448
#[stable(since = "1.7.0", feature = "ip_17")]
439449
pub fn is_loopback(&self) -> bool {
@@ -458,6 +468,7 @@ impl Ipv6Addr {
458468
/// Returns true if this is a unique local address (fc00::/7).
459469
///
460470
/// This property is defined in [RFC 4193].
471+
///
461472
/// [RFC 4193]: https://tools.ietf.org/html/rfc4193
462473
pub fn is_unique_local(&self) -> bool {
463474
(self.segments()[0] & 0xfe00) == 0xfc00
@@ -466,6 +477,7 @@ impl Ipv6Addr {
466477
/// Returns true if the address is unicast and link-local (fe80::/10).
467478
///
468479
/// This property is defined in [RFC 4291].
480+
///
469481
/// [RFC 4291]: https://tools.ietf.org/html/rfc4291
470482
pub fn is_unicast_link_local(&self) -> bool {
471483
(self.segments()[0] & 0xffc0) == 0xfe80
@@ -481,6 +493,7 @@ impl Ipv6Addr {
481493
/// (2001:db8::/32).
482494
///
483495
/// This property is defined in [RFC 3849].
496+
///
484497
/// [RFC 3849]: https://tools.ietf.org/html/rfc3849
485498
pub fn is_documentation(&self) -> bool {
486499
(self.segments()[0] == 0x2001) && (self.segments()[1] == 0xdb8)
@@ -524,6 +537,7 @@ impl Ipv6Addr {
524537
/// Returns true if this is a multicast address (ff00::/8).
525538
///
526539
/// This property is defined by [RFC 4291].
540+
///
527541
/// [RFC 4291]: https://tools.ietf.org/html/rfc4291
528542
#[stable(since = "1.7.0", feature = "ip_17")]
529543
pub fn is_multicast(&self) -> bool {

src/libstd/net/tcp.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,12 @@ pub struct TcpListener(net_imp::TcpListener);
6767

6868
/// An infinite iterator over the connections from a `TcpListener`.
6969
///
70-
/// This iterator will infinitely yield `Some` of the accepted connections. It
70+
/// This iterator will infinitely yield [`Some`] of the accepted connections. It
7171
/// is equivalent to calling `accept` in a loop.
7272
///
7373
/// This `struct` is created by the [`incoming`] method on [`TcpListener`].
7474
///
75+
/// [`Some`]: ../../std/option/enum.Option.html#variant.Some
7576
/// [`incoming`]: struct.TcpListener.html#method.incoming
7677
/// [`TcpListener`]: struct.TcpListener.html
7778
#[stable(feature = "rust1", since = "1.0.0")]

0 commit comments

Comments
 (0)