Skip to content

Commit 6aa0182

Browse files
committed
Update documentation to reflect ignoring of unknown addresses
1 parent a03a82e commit 6aa0182

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/libstd/net/addr.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,9 @@ impl hash::Hash for SocketAddrV6 {
344344
/// some other type (e.g. a string) just for it to be converted back to
345345
/// `SocketAddr` in constructor methods is pointless.
346346
///
347+
/// Addresses returned by the operating system that are not IP addresses are
348+
/// silently ignored.
349+
///
347350
/// Some examples:
348351
///
349352
/// ```no_run

src/libstd/net/mod.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@ impl Iterator for LookupHost {
107107
/// This method may perform a DNS query to resolve `host` and may also inspect
108108
/// system configuration to resolve the specified hostname.
109109
///
110+
/// The returned iterator will skip over any unknown addresses returned by the
111+
/// operating system.
112+
///
110113
/// # Examples
111114
///
112115
/// ```no_run
@@ -116,7 +119,7 @@ impl Iterator for LookupHost {
116119
///
117120
/// # fn foo() -> std::io::Result<()> {
118121
/// for host in try!(net::lookup_host("rust-lang.org")) {
119-
/// println!("found address: {}", try!(host));
122+
/// println!("found address: {}", host);
120123
/// }
121124
/// # Ok(())
122125
/// # }

0 commit comments

Comments
 (0)