Skip to content

Commit a3277e2

Browse files
authored
Rollup merge of #84257 - joshtriplett:inaddr-any, r=m-ou-se
Add documentation to help people find `Ipv4Addr::UNSPECIFIED` People looking for `INADDR_ANY` don't always find `Ipv4Addr::UNSPECIFIED`; add some documentation to help.
2 parents d919a5a + 9aa4d06 commit a3277e2

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

library/std/src/net/ip.rs

+3
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,8 @@ impl Ipv4Addr {
334334

335335
/// An IPv4 address representing an unspecified address: 0.0.0.0
336336
///
337+
/// This corresponds to the constant `INADDR_ANY` in other languages.
338+
///
337339
/// # Examples
338340
///
339341
/// ```
@@ -342,6 +344,7 @@ impl Ipv4Addr {
342344
/// let addr = Ipv4Addr::UNSPECIFIED;
343345
/// assert_eq!(addr, Ipv4Addr::new(0, 0, 0, 0));
344346
/// ```
347+
#[doc(alias = "INADDR_ANY")]
345348
#[stable(feature = "ip_constructors", since = "1.30.0")]
346349
pub const UNSPECIFIED: Self = Ipv4Addr::new(0, 0, 0, 0);
347350

0 commit comments

Comments
 (0)