From 2b51554ff59d1e5cbf8dd2db65d278b0202a9102 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 27 Jun 2026 03:52:05 +0900 Subject: refactor: fix compiler warnings and clippy warnings --- crates/shirabe/src/util/http/curl_downloader.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'crates/shirabe/src/util/http') diff --git a/crates/shirabe/src/util/http/curl_downloader.rs b/crates/shirabe/src/util/http/curl_downloader.rs index b49adf7..66ca326 100644 --- a/crates/shirabe/src/util/http/curl_downloader.rs +++ b/crates/shirabe/src/util/http/curl_downloader.rs @@ -406,12 +406,11 @@ impl CurlDownloader { if curl_response.inner.get_status_code() >= 300 && curl_response.inner.get_header("content-type").as_deref() == Some("application/json") + && let Some(body) = curl_response.inner.get_body() { - if let Some(body) = curl_response.inner.get_body() { - let decoded = shirabe_php_shim::json_decode(body, true)?; - if let PhpMixed::Array(a) = decoded { - HttpDownloader::output_warnings(self.io.clone(), &origin, &a)?; - } + let decoded = shirabe_php_shim::json_decode(body, true)?; + if let PhpMixed::Array(a) = decoded { + HttpDownloader::output_warnings(self.io.clone(), &origin, &a)?; } } @@ -527,7 +526,7 @@ impl CurlDownloader { // Atomic rename of the `~` temp file to its final name (file mode). if let Some(filename) = &filename { - rename(&format!("{}~", filename), filename); + rename(format!("{}~", filename), filename); } self.resolve_job(id, curl_response.inner); -- cgit v1.3.1