]> git.lizzy.rs Git - rust.git/commitdiff
Improve libstd/net/addr.rs documentation.
authorNick Hamann <nick@wabbo.org>
Wed, 29 Apr 2015 21:24:44 +0000 (16:24 -0500)
committerNick Hamann <nick@wabbo.org>
Wed, 29 Apr 2015 21:24:44 +0000 (16:24 -0500)
This adds some missing punctuation and converts uses of "Gets" to
"Returns". This sounds better to my ear, but more importantly is
more consistent with the documentation from other files.

src/libstd/net/addr.rs

index 2e34e46726fb27b84240ce2d3b10d983856137c2..b0bf9d0f8062674785c21a37fdb27c82ca530cfe 100644 (file)
@@ -41,7 +41,7 @@ pub enum SocketAddr {
 #[stable(feature = "rust1", since = "1.0.0")]
 pub struct SocketAddrV4 { inner: libc::sockaddr_in }
 
-/// An IPv6 socket address
+/// An IPv6 socket address.
 #[derive(Copy)]
 #[stable(feature = "rust1", since = "1.0.0")]
 pub struct SocketAddrV6 { inner: libc::sockaddr_in6 }
@@ -56,7 +56,7 @@ pub fn new(ip: IpAddr, port: u16) -> SocketAddr {
         }
     }
 
-    /// Gets the IP address associated with this socket address.
+    /// Returns the IP address associated with this socket address.
     #[unstable(feature = "ip_addr", reason = "recent addition")]
     pub fn ip(&self) -> IpAddr {
         match *self {
@@ -65,7 +65,7 @@ pub fn ip(&self) -> IpAddr {
         }
     }
 
-    /// Gets the port number associated with this socket address
+    /// Returns the port number associated with this socket address.
     #[stable(feature = "rust1", since = "1.0.0")]
     pub fn port(&self) -> u16 {
         match *self {
@@ -89,7 +89,7 @@ pub fn new(ip: Ipv4Addr, port: u16) -> SocketAddrV4 {
         }
     }
 
-    /// Gets the IP address associated with this socket address.
+    /// Returns the IP address associated with this socket address.
     #[stable(feature = "rust1", since = "1.0.0")]
     pub fn ip(&self) -> &Ipv4Addr {
         unsafe {
@@ -97,7 +97,7 @@ pub fn ip(&self) -> &Ipv4Addr {
         }
     }
 
-    /// Gets the port number associated with this socket address
+    /// Returns the port number associated with this socket address.
     #[stable(feature = "rust1", since = "1.0.0")]
     pub fn port(&self) -> u16 { ntoh(self.inner.sin_port) }
 }
@@ -120,7 +120,7 @@ pub fn new(ip: Ipv6Addr, port: u16, flowinfo: u32, scope_id: u32)
         }
     }
 
-    /// Gets the IP address associated with this socket address.
+    /// Returns the IP address associated with this socket address.
     #[stable(feature = "rust1", since = "1.0.0")]
     pub fn ip(&self) -> &Ipv6Addr {
         unsafe {
@@ -128,16 +128,16 @@ pub fn ip(&self) -> &Ipv6Addr {
         }
     }
 
-    /// Gets the port number associated with this socket address
+    /// Returns the port number associated with this socket address.
     #[stable(feature = "rust1", since = "1.0.0")]
     pub fn port(&self) -> u16 { ntoh(self.inner.sin6_port) }
 
-    /// Gets scope ID associated with this address, corresponding to the
+    /// Returns scope ID associated with this address, corresponding to the
     /// `sin6_flowinfo` field in C.
     #[stable(feature = "rust1", since = "1.0.0")]
     pub fn flowinfo(&self) -> u32 { ntoh(self.inner.sin6_flowinfo) }
 
-    /// Gets scope ID associated with this address, corresponding to the
+    /// Returns scope ID associated with this address, corresponding to the
     /// `sin6_scope_id` field in C.
     #[stable(feature = "rust1", since = "1.0.0")]
     pub fn scope_id(&self) -> u32 { ntoh(self.inner.sin6_scope_id) }