From 783679cfc44ec74d2fd34d25b346f05d9a26da71 Mon Sep 17 00:00:00 2001 From: rami3l Date: Sun, 8 Oct 2023 20:47:48 +0800 Subject: [PATCH] Apply more `clippy` suggestions --- download/tests/read-proxy-env.rs | 3 +-- src/utils/utils.rs | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/download/tests/read-proxy-env.rs b/download/tests/read-proxy-env.rs index c6b8c72074..5b3e88ea0a 100644 --- a/download/tests/read-proxy-env.rs +++ b/download/tests/read-proxy-env.rs @@ -74,8 +74,7 @@ fn socks_proxy_request() { let s = e.source().unwrap(); assert!( s.to_string().contains("socks connect error"), - "Expected socks connect error, got: {}", - s.to_string() + "Expected socks connect error, got: {s}", ); assert_eq!(CALL_COUNT.load(Ordering::SeqCst), 1); } else { diff --git a/src/utils/utils.rs b/src/utils/utils.rs index 373a72d8a4..e4d7e9adb9 100644 --- a/src/utils/utils.rs +++ b/src/utils/utils.rs @@ -151,7 +151,7 @@ pub(crate) fn download_file_with_resume( match download_file_(url, path, hasher, resume_from_partial, notify_handler) { Ok(_) => Ok(()), Err(e) => { - if let Some(_) = e.downcast_ref::() { + if e.downcast_ref::().is_some() { return Err(e); } let is_client_error = match e.downcast_ref::() {