File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -271,10 +271,13 @@ pub(crate) struct ResolvedContactPoint {
271271// It prefers to return IPv4s first, and only if there are none, IPv6s.
272272pub ( crate ) async fn resolve_hostname ( hostname : & str ) -> Result < SocketAddr , io:: Error > {
273273 let mut ret = None ;
274- let addrs: Vec < SocketAddr > = match lookup_host ( hostname) . await {
275- Ok ( addrs) => addrs . collect ( ) ,
274+ let addrs = match lookup_host ( hostname) . await {
275+ Ok ( addrs) => itertools :: Either :: Left ( addrs ) ,
276276 // Use a default port in case of error, but propagate the original error on failure
277- Err ( e) => lookup_host ( ( hostname, 9042 ) ) . await . or ( Err ( e) ) ?. collect ( ) ,
277+ Err ( e) => {
278+ let addrs = lookup_host ( ( hostname, 9042 ) ) . await . or ( Err ( e) ) ?;
279+ itertools:: Either :: Right ( addrs)
280+ }
278281 } ;
279282 for a in addrs {
280283 match a {
You can’t perform that action at this time.
0 commit comments