mirror of
https://github.com/tokio-rs/tokio.git
synced 2025-09-25 12:00:35 +00:00
net: impl ToSocketAddrs for &[SocketAddr] (#2604)
This commit is contained in:
parent
adaa6849a5
commit
1636910f0a
@ -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 =====
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user