[pbs-devel] [PATCH proxmox 2/2] rest-server: use variables directly in format strings

Filip Schauer f.schauer at proxmox.com
Tue Oct 7 12:17:48 CEST 2025


These changes were suggested by clippy.

Signed-off-by: Filip Schauer <f.schauer at proxmox.com>
---
 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<E: RpcEnvironment + Clone> H2Service<E> {
             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





More information about the pbs-devel mailing list