fix: async DNS resolving

This commit is contained in:
DarkCat09 2024-08-09 18:49:08 +04:00
parent d6db194a1a
commit 2a097fb800
Signed by: DarkCat09
GPG key ID: 0A26CD5B3345D6E3

View file

@ -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<Response, LibError> {
let addr = (host, port)
.to_socket_addrs()?
let addr = tokio::net::lookup_host((host, port))
.await?
.next()
.ok_or(InvalidUrl::ConvertError)?;