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::() {