reformat
This commit is contained in:
+4
-12
@@ -46,22 +46,14 @@ pub async fn check_all(
|
||||
};
|
||||
let check_result = proxy.check(&config).await;
|
||||
#[cfg(feature = "tui")]
|
||||
drop(tx.send(Event::App(AppEvent::ProxyChecked(
|
||||
proxy.protocol,
|
||||
))));
|
||||
drop(tx.send(Event::App(AppEvent::ProxyChecked(proxy.protocol))));
|
||||
match check_result {
|
||||
Ok(()) => {
|
||||
#[cfg(feature = "tui")]
|
||||
drop(tx.send(Event::App(AppEvent::ProxyWorking(
|
||||
proxy.protocol,
|
||||
))));
|
||||
drop(tx.send(Event::App(AppEvent::ProxyWorking(proxy.protocol))));
|
||||
checked_proxies.lock().push(proxy);
|
||||
}
|
||||
Err(e)
|
||||
if tracing::event_enabled!(
|
||||
tracing::Level::DEBUG
|
||||
) =>
|
||||
{
|
||||
Err(e) if tracing::event_enabled!(tracing::Level::DEBUG) => {
|
||||
tracing::debug!(
|
||||
"{} | {}",
|
||||
proxy.as_str(true),
|
||||
@@ -72,7 +64,7 @@ pub async fn check_all(
|
||||
}
|
||||
}
|
||||
} => res,
|
||||
() = token.cancelled() => ()
|
||||
() = token.cancelled() => (),
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
+4
-4
@@ -119,7 +119,7 @@ async fn download_output_dependencies(
|
||||
#[cfg(feature = "tui")]
|
||||
tx,
|
||||
) => res,
|
||||
() = token.cancelled() => Ok(())
|
||||
() = token.cancelled() => Ok(()),
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -133,7 +133,7 @@ async fn download_output_dependencies(
|
||||
#[cfg(feature = "tui")]
|
||||
tx,
|
||||
) => res,
|
||||
() = token.cancelled() => Ok(())
|
||||
() = token.cancelled() => Ok(()),
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -236,13 +236,13 @@ fn watch_signals(
|
||||
tokio::spawn(async move {
|
||||
tokio::select! {
|
||||
biased;
|
||||
() = token.cancelled() => {}
|
||||
() = token.cancelled() => {},
|
||||
_ = stream.recv() => {
|
||||
tracing::info!("Received {} signal, exiting...", signal_name);
|
||||
token.cancel();
|
||||
#[cfg(feature = "tui")]
|
||||
drop(tx.send(event::Event::App(event::AppEvent::Quit)));
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
+1
-1
@@ -147,7 +147,7 @@ pub async fn scrape_all(
|
||||
#[cfg(feature = "tui")]
|
||||
tx,
|
||||
) => res,
|
||||
() = token.cancelled() => Ok(())
|
||||
() = token.cancelled() => Ok(()),
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
+3
-3
@@ -104,11 +104,11 @@ async fn tick_event_listener(tx: tokio::sync::mpsc::UnboundedSender<Event>) {
|
||||
() = tx.closed() => {
|
||||
break;
|
||||
},
|
||||
_ = tick.tick() =>{
|
||||
_ = tick.tick() => {
|
||||
if tx.send(Event::Tick).is_err() {
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -135,7 +135,7 @@ async fn crossterm_event_listener(
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user