Skip to content

Commit 2764e54

Browse files
committed
impl ToSocketAddrs for (String, u16)
1 parent 47c3158 commit 2764e54

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/libstd/net/addr.rs

+8
Original file line numberDiff line numberDiff line change
@@ -1000,6 +1000,14 @@ impl ToSocketAddrs for (&str, u16) {
10001000
}
10011001
}
10021002

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+
10031011
// accepts strings like 'localhost:12345'
10041012
#[stable(feature = "rust1", since = "1.0.0")]
10051013
impl ToSocketAddrs for str {

0 commit comments

Comments
 (0)