public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Filip Schauer <f.schauer@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox 2/2] rest-server: use variables directly in format strings
Date: Tue,  7 Oct 2025 12:17:48 +0200	[thread overview]
Message-ID: <20251007101757.82742-3-f.schauer@proxmox.com> (raw)
In-Reply-To: <20251007101757.82742-1-f.schauer@proxmox.com>

These changes were suggested by clippy.

Signed-off-by: Filip Schauer <f.schauer@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



_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel


      parent reply	other threads:[~2025-10-07 10:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-07 10:17 [pbs-devel] [PATCH proxmox 0/2] rest-server: minor code cleanup Filip Schauer
2025-10-07 10:17 ` [pbs-devel] [PATCH proxmox 1/2] rest-server: simplify path concatenation Filip Schauer
2025-10-07 10:17 ` Filip Schauer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251007101757.82742-3-f.schauer@proxmox.com \
    --to=f.schauer@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal