about summary refs log tree commit diff
path: root/src/libstd/net
diff options
context:
space:
mode:
authorTobias Bucher <tobiasbucher5991@gmail.com>2016-06-29 11:44:33 +0200
committerTobias Bucher <tobiasbucher5991@gmail.com>2016-06-29 11:44:33 +0200
commit6aa01825204e8c3c29d104935de78df74a8e51d3 (patch)
tree4123407ae96d2376f99adbde649e6a9790426920 /src/libstd/net
parenta03a82e5e0ae59b0c0b11b671e058fda9f7bb3d0 (diff)
downloadrust-6aa01825204e8c3c29d104935de78df74a8e51d3.tar.gz
rust-6aa01825204e8c3c29d104935de78df74a8e51d3.zip
Update documentation to reflect ignoring of unknown addresses
Diffstat (limited to 'src/libstd/net')
-rw-r--r--src/libstd/net/addr.rs3
-rw-r--r--src/libstd/net/mod.rs5
2 files changed, 7 insertions, 1 deletions
diff --git a/src/libstd/net/addr.rs b/src/libstd/net/addr.rs
index 44a7823f82a..b93ca8277e6 100644
--- a/src/libstd/net/addr.rs
+++ b/src/libstd/net/addr.rs
@@ -344,6 +344,9 @@ impl hash::Hash for SocketAddrV6 {
 /// some other type (e.g. a string) just for it to be converted back to
 /// `SocketAddr` in constructor methods is pointless.
 ///
+/// Addresses returned by the operating system that are not IP addresses are
+/// silently ignored.
+///
 /// Some examples:
 ///
 /// ```no_run
diff --git a/src/libstd/net/mod.rs b/src/libstd/net/mod.rs
index 95df7f7eaeb..ac13b23ebee 100644
--- a/src/libstd/net/mod.rs
+++ b/src/libstd/net/mod.rs
@@ -107,6 +107,9 @@ impl Iterator for LookupHost {
 /// This method may perform a DNS query to resolve `host` and may also inspect
 /// system configuration to resolve the specified hostname.
 ///
+/// The returned iterator will skip over any unknown addresses returned by the
+/// operating system.
+///
 /// # Examples
 ///
 /// ```no_run
@@ -116,7 +119,7 @@ impl Iterator for LookupHost {
 ///
 /// # fn foo() -> std::io::Result<()> {
 /// for host in try!(net::lookup_host("rust-lang.org")) {
-///     println!("found address: {}", try!(host));
+///     println!("found address: {}", host);
 /// }
 /// # Ok(())
 /// # }