From a2e4f304dc54a793a7b76fa76611d456bd392cf5 Mon Sep 17 00:00:00 2001 From: alterware Date: Thu, 3 Jul 2025 10:32:57 +0200 Subject: [PATCH] chore: more linting --- src/http.rs | 14 ++++---------- src/misc.rs | 2 +- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/http.rs b/src/http.rs index c16c6de..2e09c90 100644 --- a/src/http.rs +++ b/src/http.rs @@ -64,8 +64,8 @@ pub async fn rating_request( let latency = start.elapsed(); if let Err(e) = &res { - error!("Failed to get {}: {} (after {:?})", url, e, latency); - return Err(format!("Failed to get {} {} (after {:?})", url, e, latency).into()); + error!("Failed to get {url}: {e} (after {latency:?})"); + return Err(format!("Failed to get {url} {e} (after {latency:?})").into()); } let res = res.unwrap(); @@ -74,17 +74,11 @@ pub async fn rating_request( // We don't need the response body for rating if let Err(e) = res.text().await { - warn!( - "Failed to get response text from {}: {} (after {:?})", - url, e, latency - ); + warn!("Failed to get response text from {url}: {e} (after {latency:?})"); return Err(e.into()); } - info!( - "Successfully rated {} in {:?} (cloudflare: {})", - url, latency, is_cloudflare - ); + info!("Successfully rated {url} in {latency:?} (cloudflare: {is_cloudflare})"); Ok((latency, is_cloudflare)) } diff --git a/src/misc.rs b/src/misc.rs index 5737727..ffa79cd 100644 --- a/src/misc.rs +++ b/src/misc.rs @@ -53,7 +53,7 @@ pub fn is_program_in_path(program: &str) -> bool { .and_then(|paths| { paths.to_str().map(|paths| { paths.split(';').any(|dir| { - fs::metadata(format!("{}\\{}.exe", dir, program)).is_ok() + fs::metadata(format!("{dir}\\{program}.exe")).is_ok() || fs::metadata(format!("{dir}\\{program}.cmd")).is_ok() || fs::metadata(format!("{dir}\\{program}.bat")).is_ok() })