about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorNick Hamann <nick@wabbo.org>2015-04-29 15:57:17 -0500
committerNick Hamann <nick@wabbo.org>2015-04-29 15:59:28 -0500
commit42196ae7bf3dd7eac099f0ef850f067d07506864 (patch)
tree6e800185ffa65acee04f9179331a3e97fbd99086 /src/libstd
parent551a74dddd84cf01440ee84148ebd18bc68bd7c8 (diff)
downloadrust-42196ae7bf3dd7eac099f0ef850f067d07506864.tar.gz
rust-42196ae7bf3dd7eac099f0ef850f067d07506864.zip
Improve libstd/net/udp.rs documentation.
This adds some missing punctuation, adds a missing word, and
corrects a bug in the description of `send_to`, which actually
returns the number of bytes written on success.

Fixes #24925.
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/net/udp.rs20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/libstd/net/udp.rs b/src/libstd/net/udp.rs
index 1955b895300..0b04ecb1b72 100644
--- a/src/libstd/net/udp.rs
+++ b/src/libstd/net/udp.rs
@@ -50,8 +50,8 @@ pub struct UdpSocket(net_imp::UdpSocket);
 impl UdpSocket {
     /// Creates a UDP socket from the given address.
     ///
-    /// Address type can be any implementor of `ToSocketAddr` trait. See its
-    /// documentation for concrete examples.
+    /// The address type can be any implementor of `ToSocketAddr` trait. See
+    /// its documentation for concrete examples.
     #[stable(feature = "rust1", since = "1.0.0")]
     pub fn bind<A: ToSocketAddrs>(addr: A) -> io::Result<UdpSocket> {
         super::each_addr(addr, net_imp::UdpSocket::bind).map(UdpSocket)
@@ -64,8 +64,8 @@ impl UdpSocket {
         self.0.recv_from(buf)
     }
 
-    /// Sends data on the socket to the given address. Returns nothing on
-    /// success.
+    /// Sends data on the socket to the given address. On success, returns the
+    /// number of bytes written.
     ///
     /// Address type can be any implementor of `ToSocketAddrs` trait. See its
     /// documentation for concrete examples.
@@ -95,34 +95,34 @@ impl UdpSocket {
         self.0.duplicate().map(UdpSocket)
     }
 
-    /// Sets the broadcast flag on or off
+    /// Sets the broadcast flag on or off.
     pub fn set_broadcast(&self, on: bool) -> io::Result<()> {
         self.0.set_broadcast(on)
     }
 
-    /// Sets the multicast loop flag to the specified value
+    /// Sets the multicast loop flag to the specified value.
     ///
     /// This lets multicast packets loop back to local sockets (if enabled)
     pub fn set_multicast_loop(&self, on: bool) -> io::Result<()> {
         self.0.set_multicast_loop(on)
     }
 
-    /// Joins a multicast IP address (becomes a member of it)
+    /// Joins a multicast IP address (becomes a member of it).
     pub fn join_multicast(&self, multi: &IpAddr) -> io::Result<()> {
         self.0.join_multicast(multi)
     }
 
-    /// Leaves a multicast IP address (drops membership from it)
+    /// Leaves a multicast IP address (drops membership from it).
     pub fn leave_multicast(&self, multi: &IpAddr) -> io::Result<()> {
         self.0.leave_multicast(multi)
     }
 
-    /// Sets the multicast TTL
+    /// Sets the multicast TTL.
     pub fn set_multicast_time_to_live(&self, ttl: i32) -> io::Result<()> {
         self.0.multicast_time_to_live(ttl)
     }
 
-    /// Sets this socket's TTL
+    /// Sets this socket's TTL.
     pub fn set_time_to_live(&self, ttl: i32) -> io::Result<()> {
         self.0.time_to_live(ttl)
     }