From 579d316945f30ebc14fda9ef64b01c50c447f952 Mon Sep 17 00:00:00 2001 From: Edward Shen Date: Sat, 22 May 2021 23:10:34 -0400 Subject: [PATCH] clippy --- src/cache/disk.rs | 1 + src/metrics.rs | 2 ++ src/routes.rs | 4 ++-- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/cache/disk.rs b/src/cache/disk.rs index 6ee9ea4..b8a7d50 100644 --- a/src/cache/disk.rs +++ b/src/cache/disk.rs @@ -174,6 +174,7 @@ async fn db_listener( }; let mut size_freed = 0; + #[allow(clippy::cast_sign_loss)] for item in items { size_freed += item.size as u64; tokio::spawn(remove_file(item.id)); diff --git a/src/metrics.rs b/src/metrics.rs index f0051f8..be229f3 100644 --- a/src/metrics.rs +++ b/src/metrics.rs @@ -35,7 +35,9 @@ pub static REQUESTS_OTHER_COUNTER: Lazy = Lazy::new(|| { .unwrap() }); +#[allow(clippy::shadow_unrelated)] pub fn init() { + // we just need to initialize these, getting the values registers them. let _a = CACHE_HIT_COUNTER.get(); let _a = CACHE_MISS_COUNTER.get(); let _a = REQUESTS_TOTAL_COUNTER.get(); diff --git a/src/routes.rs b/src/routes.rs index f8bf219..82ce773 100644 --- a/src/routes.rs +++ b/src/routes.rs @@ -109,10 +109,10 @@ pub async fn default(state: Data, req: HttpRequest) -> impl R return ServerResponse::HttpResponse( ErrorNotFound("Path is not valid in offline mode").into(), ); - } else { - info!("Got unknown path, just proxying: {}", path); } + info!("Got unknown path, just proxying: {}", path); + let resp = match HTTP_CLIENT.get(path).send().await { Ok(resp) => resp, Err(e) => {