mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-17 00:00:11 +02:00
net: impl ToSocketAddrs for &[SocketAddr] (#2604)
This commit is contained in:
@@ -121,6 +121,20 @@ impl sealed::ToSocketAddrsPriv for (Ipv6Addr, u16) {
|
||||
}
|
||||
}
|
||||
|
||||
// ===== impl &[SocketAddr] =====
|
||||
|
||||
impl ToSocketAddrs for &[SocketAddr] {}
|
||||
|
||||
impl sealed::ToSocketAddrsPriv for &[SocketAddr] {
|
||||
type Iter = std::vec::IntoIter<SocketAddr>;
|
||||
type Future = ReadyFuture<Self::Iter>;
|
||||
|
||||
fn to_socket_addrs(&self) -> Self::Future {
|
||||
let iter = self.to_vec().into_iter();
|
||||
future::ok(iter)
|
||||
}
|
||||
}
|
||||
|
||||
cfg_dns! {
|
||||
// ===== impl str =====
|
||||
|
||||
|
||||
Reference in New Issue
Block a user