diff --git a/src/checker.rs b/src/checker.rs index 2b6f326..e7c3b6d 100644 --- a/src/checker.rs +++ b/src/checker.rs @@ -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() => (), } }); } diff --git a/src/main.rs b/src/main.rs index ce24729..e433df7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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))); - } + }, } }); } diff --git a/src/scraper.rs b/src/scraper.rs index c3a7b87..e0758d1 100644 --- a/src/scraper.rs +++ b/src/scraper.rs @@ -147,7 +147,7 @@ pub async fn scrape_all( #[cfg(feature = "tui")] tx, ) => res, - () = token.cancelled() => Ok(()) + () = token.cancelled() => Ok(()), } }); } diff --git a/src/tui.rs b/src/tui.rs index 7384101..0cfd697 100644 --- a/src/tui.rs +++ b/src/tui.rs @@ -104,11 +104,11 @@ async fn tick_event_listener(tx: tokio::sync::mpsc::UnboundedSender) { () = 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; } } - } + }, } } }