From 9593b97fbe351854dcc43312188dff97a57bb645 Mon Sep 17 00:00:00 2001 From: Ferdinand Schober Date: Sat, 14 Sep 2024 16:41:24 +0200 Subject: [PATCH] formatting --- src/dns.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/dns.rs b/src/dns.rs index 0b923d51..bea583f5 100644 --- a/src/dns.rs +++ b/src/dns.rs @@ -1,5 +1,5 @@ use local_channel::mpsc::{channel, Receiver, Sender}; -use tokio::task::{JoinHandle, spawn_local}; +use tokio::task::{spawn_local, JoinHandle}; use hickory_resolver::{error::ResolveError, TokioAsyncResolver}; @@ -16,10 +16,7 @@ impl DnsResolver { let resolver = TokioAsyncResolver::tokio_from_system_conf()?; let (tx, rx) = channel(); let _task = spawn_local(Self::run(server, resolver, rx)); - Ok(Self { - _task, - tx, - }) + Ok(Self { _task, tx }) } pub(crate) fn resolve(&self, host: ClientHandle) { @@ -33,7 +30,11 @@ impl DnsResolver { } } - async fn do_dns(server: &Server, resolver: &TokioAsyncResolver, rx: &mut Receiver) { + async fn do_dns( + server: &Server, + resolver: &TokioAsyncResolver, + rx: &mut Receiver, + ) { loop { let handle = rx.recv().await.expect("channel closed");