Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
feschber committed Nov 7, 2024
1 parent ae5f3e5 commit 9593b97
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/dns.rs
Original file line number Diff line number Diff line change
@@ -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};

Expand All @@ -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) {
Expand All @@ -33,7 +30,11 @@ impl DnsResolver {
}
}

async fn do_dns(server: &Server, resolver: &TokioAsyncResolver, rx: &mut Receiver<ClientHandle>) {
async fn do_dns(
server: &Server,
resolver: &TokioAsyncResolver,
rx: &mut Receiver<ClientHandle>,
) {
loop {
let handle = rx.recv().await.expect("channel closed");

Expand Down

0 comments on commit 9593b97

Please sign in to comment.