From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ronja.mits.lan by ronja.mits.lan with LMTP id OKIJAxMNfGaXGQAAxxbTJA (envelope-from ); Wed, 26 Jun 2024 14:44:03 +0200 Received: from proxmox-new.maurer-it.com (unknown [192.168.2.33]) by ronja.mits.lan (Postfix) with ESMTPS id EC978F63AFC; Wed, 26 Jun 2024 14:44:02 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id CE1AC48739; Wed, 26 Jun 2024 14:44:02 +0200 (CEST) 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 (4096 bits)) (No client certificate requested) by proxmox-new.maurer-it.com (Proxmox) with ESMTPS; Wed, 26 Jun 2024 14:44:02 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 9F6B2C45; Wed, 26 Jun 2024 14:43:57 +0200 (CEST) From: Maximiliano Sandoval To: pbs-devel@lists.proxmox.com Date: Wed, 26 Jun 2024 14:43:43 +0200 Message-Id: <20240626124346.531790-15-m.sandoval@proxmox.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240626124346.531790-1-m.sandoval@proxmox.com> References: <20240626124346.531790-1-m.sandoval@proxmox.com> MIME-Version: 1.0 Subject: [pbs-devel] [PATCH proxmox v2 15/18] acme: derive Default for Status 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" X-SPAM-LEVEL: Spam detection results: 0 DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment KAM_LAZY_DOMAIN_SECURITY 1 Sending domain does not have any anti-forgery methods MAILING_LIST_MULTI -2 Multiple indicators imply a widely-seen list manager RAZOR2_CF_RANGE_51_100 2.43 Razor2 gives confidence level above 50% RAZOR2_CHECK 1.729 Listed in Razor2 (http://razor.sf.net/) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_NONE 0.001 SPF: sender does not publish an SPF Record Fixes the clippy warning: warning: this `impl` can be derived --> proxmox-acme/src/order.rs:36:1 | 36 | / impl Default for Status { 37 | | fn default() -> Self { 38 | | Status::New 39 | | } 40 | | } | |_^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls = note: `#[warn(clippy::derivable_impls)]` on by default = help: remove the manual implementation... help: ...and instead derive it... | 12 + #[derive(Default)] 13 | pub enum Status { | help: ...and mark the default variant | 15 ~ #[default] 16 ~ New, | Signed-off-by: Maximiliano Sandoval --- proxmox-acme/src/order.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/proxmox-acme/src/order.rs b/proxmox-acme/src/order.rs index 404d4ae7..b6551004 100644 --- a/proxmox-acme/src/order.rs +++ b/proxmox-acme/src/order.rs @@ -9,9 +9,11 @@ use crate::Error; /// Status of an [`Order`]. #[derive(Clone, Copy, Debug, Eq, PartialEq, Deserialize, Serialize)] #[serde(rename_all = "lowercase")] +#[derive(Default)] 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 +35,6 @@ pub enum Status { Valid, } -impl Default for Status { - fn default() -> Self { - Status::New - } -} - impl Status { /// Serde helper fn is_new(&self) -> bool { -- 2.39.2 _______________________________________________ pbs-devel mailing list pbs-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel