Skip to content

Commit 2baeabd

Browse files
author
Nick Hamann
committed
Improve libstd/net/addr.rs documentation.
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.
1 parent a237ceb commit 2baeabd

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/libstd/net/addr.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ pub enum SocketAddr {
4141
#[stable(feature = "rust1", since = "1.0.0")]
4242
pub struct SocketAddrV4 { inner: libc::sockaddr_in }
4343

44-
/// An IPv6 socket address
44+
/// An IPv6 socket address.
4545
#[derive(Copy)]
4646
#[stable(feature = "rust1", since = "1.0.0")]
4747
pub struct SocketAddrV6 { inner: libc::sockaddr_in6 }
@@ -56,7 +56,7 @@ impl SocketAddr {
5656
}
5757
}
5858

59-
/// Gets the IP address associated with this socket address.
59+
/// Returns the IP address associated with this socket address.
6060
#[unstable(feature = "ip_addr", reason = "recent addition")]
6161
pub fn ip(&self) -> IpAddr {
6262
match *self {
@@ -65,7 +65,7 @@ impl SocketAddr {
6565
}
6666
}
6767

68-
/// Gets the port number associated with this socket address
68+
/// Returns the port number associated with this socket address.
6969
#[stable(feature = "rust1", since = "1.0.0")]
7070
pub fn port(&self) -> u16 {
7171
match *self {
@@ -89,15 +89,15 @@ impl SocketAddrV4 {
8989
}
9090
}
9191

92-
/// Gets the IP address associated with this socket address.
92+
/// Returns the IP address associated with this socket address.
9393
#[stable(feature = "rust1", since = "1.0.0")]
9494
pub fn ip(&self) -> &Ipv4Addr {
9595
unsafe {
9696
&*(&self.inner.sin_addr as *const libc::in_addr as *const Ipv4Addr)
9797
}
9898
}
9999

100-
/// Gets the port number associated with this socket address
100+
/// Returns the port number associated with this socket address.
101101
#[stable(feature = "rust1", since = "1.0.0")]
102102
pub fn port(&self) -> u16 { ntoh(self.inner.sin_port) }
103103
}
@@ -120,24 +120,24 @@ impl SocketAddrV6 {
120120
}
121121
}
122122

123-
/// Gets the IP address associated with this socket address.
123+
/// Returns the IP address associated with this socket address.
124124
#[stable(feature = "rust1", since = "1.0.0")]
125125
pub fn ip(&self) -> &Ipv6Addr {
126126
unsafe {
127127
&*(&self.inner.sin6_addr as *const libc::in6_addr as *const Ipv6Addr)
128128
}
129129
}
130130

131-
/// Gets the port number associated with this socket address
131+
/// Returns the port number associated with this socket address.
132132
#[stable(feature = "rust1", since = "1.0.0")]
133133
pub fn port(&self) -> u16 { ntoh(self.inner.sin6_port) }
134134

135-
/// Gets scope ID associated with this address, corresponding to the
135+
/// Returns scope ID associated with this address, corresponding to the
136136
/// `sin6_flowinfo` field in C.
137137
#[stable(feature = "rust1", since = "1.0.0")]
138138
pub fn flowinfo(&self) -> u32 { ntoh(self.inner.sin6_flowinfo) }
139139

140-
/// Gets scope ID associated with this address, corresponding to the
140+
/// Returns scope ID associated with this address, corresponding to the
141141
/// `sin6_scope_id` field in C.
142142
#[stable(feature = "rust1", since = "1.0.0")]
143143
pub fn scope_id(&self) -> u32 { ntoh(self.inner.sin6_scope_id) }

0 commit comments

Comments
 (0)