We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 47c3158 commit 2764e54Copy full SHA for 2764e54
src/libstd/net/addr.rs
@@ -1000,6 +1000,14 @@ impl ToSocketAddrs for (&str, u16) {
1000
}
1001
1002
1003
+#[stable(feature = "string_u16_to_socket_addrs", since = "1.46.0")]
1004
+impl ToSocketAddrs for (String, u16) {
1005
+ type Iter = vec::IntoIter<SocketAddr>;
1006
+ fn to_socket_addrs(&self) -> io::Result<vec::IntoIter<SocketAddr>> {
1007
+ (&*self.0, self.1).to_socket_addrs()
1008
+ }
1009
+}
1010
+
1011
// accepts strings like 'localhost:12345'
1012
#[stable(feature = "rust1", since = "1.0.0")]
1013
impl ToSocketAddrs for str {
0 commit comments