提交 2764e54c 编写于 作者: Y Yoshua Wuyts

impl ToSocketAddrs for (String, u16)

上级 47c3158c
......@@ -1000,6 +1000,14 @@ fn to_socket_addrs(&self) -> io::Result<vec::IntoIter<SocketAddr>> {
}
}
#[stable(feature = "string_u16_to_socket_addrs", since = "1.46.0")]
impl ToSocketAddrs for (String, u16) {
type Iter = vec::IntoIter<SocketAddr>;
fn to_socket_addrs(&self) -> io::Result<vec::IntoIter<SocketAddr>> {
(&*self.0, self.1).to_socket_addrs()
}
}
// accepts strings like 'localhost:12345'
#[stable(feature = "rust1", since = "1.0.0")]
impl ToSocketAddrs for str {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册