Skip to content

Commit

Permalink
net: impl ToSocketAddrs for (String, u16) (#2724)
Browse files Browse the repository at this point in the history
  • Loading branch information
nanpuyue committed Aug 1, 2020
1 parent 9f0b6d3 commit 7276d47
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tokio/src/net/addr.rs
Expand Up @@ -201,6 +201,19 @@ cfg_dns! {
}
}

// ===== impl (String, u16) =====

impl ToSocketAddrs for (String, u16) {}

impl sealed::ToSocketAddrsPriv for (String, u16) {
type Iter = sealed::OneOrMore;
type Future = sealed::MaybeReady;

fn to_socket_addrs(&self) -> Self::Future {
(self.0.as_str(), self.1).to_socket_addrs()
}
}

// ===== impl String =====

impl ToSocketAddrs for String {}
Expand Down

0 comments on commit 7276d47

Please sign in to comment.