From 2a097fb800302fd238244e42581c01e02bfdee10 Mon Sep 17 00:00:00 2001 From: DarkCat09 Date: Fri, 9 Aug 2024 18:49:08 +0400 Subject: [PATCH] fix: async DNS resolving --- src/client/mod.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/client/mod.rs b/src/client/mod.rs index 423a074..3f87b88 100644 --- a/src/client/mod.rs +++ b/src/client/mod.rs @@ -8,7 +8,6 @@ pub use response::Response; use crate::{error::*, status::*}; use builder::ClientBuilder; -use std::net::ToSocketAddrs; use std::sync::Arc; use tokio::{ @@ -94,8 +93,8 @@ impl Client { host: &str, port: u16, ) -> Result { - let addr = (host, port) - .to_socket_addrs()? + let addr = tokio::net::lookup_host((host, port)) + .await? .next() .ok_or(InvalidUrl::ConvertError)?;