From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <l.wagner@proxmox.com>
Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by lists.proxmox.com (Postfix) with ESMTPS id CE8E6B882A
 for <pbs-devel@lists.proxmox.com>; Tue,  5 Dec 2023 13:31:50 +0100 (CET)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
 by firstgate.proxmox.com (Proxmox) with ESMTP id B52A21AA76
 for <pbs-devel@lists.proxmox.com>; Tue,  5 Dec 2023 13:31:20 +0100 (CET)
Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com
 [94.136.29.106])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by firstgate.proxmox.com (Proxmox) with ESMTPS
 for <pbs-devel@lists.proxmox.com>; Tue,  5 Dec 2023 13:31:20 +0100 (CET)
Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1])
 by proxmox-new.maurer-it.com (Proxmox) with ESMTP id DE17044C76
 for <pbs-devel@lists.proxmox.com>; Tue,  5 Dec 2023 13:31:19 +0100 (CET)
From: Lukas Wagner <l.wagner@proxmox.com>
To: pbs-devel@lists.proxmox.com
Date: Tue,  5 Dec 2023 13:31:15 +0100
Message-Id: <20231205123115.187815-2-l.wagner@proxmox.com>
X-Mailer: git-send-email 2.39.2
In-Reply-To: <20231205123115.187815-1-l.wagner@proxmox.com>
References: <20231205123115.187815-1-l.wagner@proxmox.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
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
 T_SCC_BODY_TEXT_LINE    -0.01 -
 URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See
 http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more
 information. [order.rs, rest.rs, util.rs]
Subject: [pbs-devel] [PATCH proxmox 2/2] tree-wide: clippy fixes
X-BeenThere: pbs-devel@lists.proxmox.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Proxmox Backup Server development discussion
 <pbs-devel.lists.proxmox.com>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pbs-devel>, 
 <mailto:pbs-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pbs-devel/>
List-Post: <mailto:pbs-devel@lists.proxmox.com>
List-Help: <mailto:pbs-devel-request@lists.proxmox.com?subject=help>
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel>, 
 <mailto:pbs-devel-request@lists.proxmox.com?subject=subscribe>
X-List-Received-Date: Tue, 05 Dec 2023 12:31:50 -0000

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
---
 proxmox-acme/src/order.rs              | 9 ++-------
 proxmox-api-macro/src/util.rs          | 2 +-
 proxmox-rest-server/src/rest.rs        | 2 +-
 proxmox-rest-server/src/worker_task.rs | 2 +-
 4 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/proxmox-acme/src/order.rs b/proxmox-acme/src/order.rs
index 404d4ae..97c068c 100644
--- a/proxmox-acme/src/order.rs
+++ b/proxmox-acme/src/order.rs
@@ -7,11 +7,12 @@ use crate::request::Request;
 use crate::Error;
 
 /// Status of an [`Order`].
-#[derive(Clone, Copy, Debug, Eq, PartialEq, Deserialize, Serialize)]
+#[derive(Clone, Copy, Debug, Default, Eq, PartialEq, Deserialize, Serialize)]
 #[serde(rename_all = "lowercase")]
 pub enum Status {
     /// Invalid, used as a place holder for when sending objects as contrary to account creation,
     /// the Acme RFC does not require the server to ignore unknown parts of the `Order` object.
+    #[default]
     New,
 
     /// Authorization failed and it is now invalid.
@@ -33,12 +34,6 @@ pub enum Status {
     Valid,
 }
 
-impl Default for Status {
-    fn default() -> Self {
-        Status::New
-    }
-}
-
 impl Status {
     /// Serde helper
     fn is_new(&self) -> bool {
diff --git a/proxmox-api-macro/src/util.rs b/proxmox-api-macro/src/util.rs
index 324c460..428b1e4 100644
--- a/proxmox-api-macro/src/util.rs
+++ b/proxmox-api-macro/src/util.rs
@@ -865,7 +865,7 @@ pub fn parse_str_value_to_option<T: Parse>(
     path: &syn::Path,
     nv: syn::parse::ParseStream<'_>,
 ) {
-    duplicate(&*target, &path);
+    duplicate(&*target, path);
     match nv.parse().and_then(|lit| parse_lit_str(&lit)) {
         Ok(value) => *target = Some(value),
         Err(err) => crate::add_error(err),
diff --git a/proxmox-rest-server/src/rest.rs b/proxmox-rest-server/src/rest.rs
index 39f98e5..25cafb2 100644
--- a/proxmox-rest-server/src/rest.rs
+++ b/proxmox-rest-server/src/rest.rs
@@ -155,7 +155,7 @@ impl Service<Request<Body>> for RedirectService {
 
                 Response::builder()
                     .status(status_code)
-                    .header("Location", String::from(location_value))
+                    .header("Location", location_value)
                     .body(Body::empty())?
             } else {
                 Response::builder()
diff --git a/proxmox-rest-server/src/worker_task.rs b/proxmox-rest-server/src/worker_task.rs
index 4cf24cc..5bab4cd 100644
--- a/proxmox-rest-server/src/worker_task.rs
+++ b/proxmox-rest-server/src/worker_task.rs
@@ -850,7 +850,7 @@ impl WorkerTask {
             file_opts: setup.file_opts.clone(),
             ..Default::default()
         };
-        let logger = FileLogger::new(&path, logger_options)?;
+        let logger = FileLogger::new(path, logger_options)?;
 
         let worker = Arc::new(Self {
             setup,
-- 
2.39.2