From c6fd77bc018e534f2794267ee8482e810b3b810c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christina=20S=C3=B8rensen?= Date: Thu, 5 Sep 2024 07:48:21 +0200 Subject: [PATCH] fix: don't output empty lines without loglevel' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christina Sørensen --- crates/nix-weather/src/net.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/crates/nix-weather/src/net.rs b/crates/nix-weather/src/net.rs index bd21e05..6f693cd 100644 --- a/crates/nix-weather/src/net.rs +++ b/crates/nix-weather/src/net.rs @@ -9,8 +9,7 @@ use async_recursion::async_recursion; use reqwest::Client; use tokio::time::sleep; -#[allow(unused)] -use log::{debug, error, info, trace, warn}; +use log; const MAX_SLIDE: u64 = 1000; @@ -29,8 +28,7 @@ pub async fn nar_exists(client: Client, domain: &str, hash: &str, slide: u64) -> // // Writng an actual sliding window seems kinda hard, // so we do this instead. - trace!("rate limited! {slide}"); - println!(""); + log::trace!("rate limited! {slide}"); sleep(Duration::from_millis(slide)).await; nar_exists(client, domain, hash, std::cmp::min(slide * 2, MAX_SLIDE)).await }