From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 5DD041FF191 for ; Tue, 7 Oct 2025 12:19:21 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id CDE291554B; Tue, 7 Oct 2025 12:19:25 +0200 (CEST) From: Filip Schauer To: pbs-devel@lists.proxmox.com Date: Tue, 7 Oct 2025 12:17:48 +0200 Message-ID: <20251007101757.82742-3-f.schauer@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251007101757.82742-1-f.schauer@proxmox.com> References: <20251007101757.82742-1-f.schauer@proxmox.com> MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1759832333874 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.007 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pbs-devel] [PATCH proxmox 2/2] rest-server: use variables directly in format strings X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox Backup Server development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pbs-devel-bounces@lists.proxmox.com Sender: "pbs-devel" These changes were suggested by clippy. Signed-off-by: Filip Schauer --- proxmox-rest-server/src/h2service.rs | 2 +- proxmox-rest-server/src/rest.rs | 2 +- proxmox-rest-server/src/worker_task.rs | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/proxmox-rest-server/src/h2service.rs b/proxmox-rest-server/src/h2service.rs index 18258e14..09843477 100644 --- a/proxmox-rest-server/src/h2service.rs +++ b/proxmox-rest-server/src/h2service.rs @@ -55,7 +55,7 @@ impl H2Service { Err(err) => return future::err(http_err!(BAD_REQUEST, "{}", err)).boxed(), }; - self.debug(format!("{} {}", method, path)); + self.debug(format!("{method} {path}")); let mut uri_param = HashMap::new(); diff --git a/proxmox-rest-server/src/rest.rs b/proxmox-rest-server/src/rest.rs index 95060641..b76c4bc9 100644 --- a/proxmox-rest-server/src/rest.rs +++ b/proxmox-rest-server/src/rest.rs @@ -512,7 +512,7 @@ async fn proxy_protected_request( let mut request = Request::from_parts(parts, req_body); request.headers_mut().insert( header::FORWARDED, - format!("for=\"{}\";", peer).parse().unwrap(), + format!("for=\"{peer}\";").parse().unwrap(), ); let reload_timezone = info.reload_timezone; diff --git a/proxmox-rest-server/src/worker_task.rs b/proxmox-rest-server/src/worker_task.rs index 1f9578c8..84965f25 100644 --- a/proxmox-rest-server/src/worker_task.rs +++ b/proxmox-rest-server/src/worker_task.rs @@ -631,8 +631,8 @@ impl TaskState { fn result_text(&self) -> String { match self { - TaskState::Error { message, .. } => format!("TASK ERROR: {}", message), - other => format!("TASK {}", other), + TaskState::Error { message, .. } => format!("TASK ERROR: {message}"), + other => format!("TASK {other}"), } } @@ -675,8 +675,8 @@ impl std::fmt::Display for TaskState { match self { TaskState::Unknown { .. } => write!(f, "unknown"), TaskState::OK { .. } => write!(f, "OK"), - TaskState::Warning { count, .. } => write!(f, "WARNINGS: {}", count), - TaskState::Error { message, .. } => write!(f, "{}", message), + TaskState::Warning { count, .. } => write!(f, "WARNINGS: {count}"), + TaskState::Error { message, .. } => write!(f, "{message}"), } } } -- 2.47.3 _______________________________________________ pbs-devel mailing list pbs-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel