impl ToSocketAddrs for (String, u16) · rust-lang/rust@2764e54 (original) (raw)

Original file line number Diff line number Diff line change
@@ -1000,6 +1000,14 @@ impl ToSocketAddrs for (&str, u16) {
1000 1000 }
1001 1001 }
1002 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 +
1003 1011 // accepts strings like 'localhost:12345'
1004 1012 #[stable(feature = "rust1", since = "1.0.0")]
1005 1013 impl ToSocketAddrs for str {