From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 2FD207DF8C for ; Tue, 9 Nov 2021 17:59:33 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 2576911526 for ; Tue, 9 Nov 2021 17:59:03 +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 id 2D4C4114D8 for ; Tue, 9 Nov 2021 17:59:01 +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 6780F46917 for ; Tue, 9 Nov 2021 17:54:33 +0100 (CET) From: Stoiko Ivanov To: pbs-devel@lists.proxmox.com Date: Tue, 9 Nov 2021 16:54:17 +0000 Message-Id: <20211109165422.311089-4-s.ivanov@proxmox.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211109165422.311089-1-s.ivanov@proxmox.com> References: <20211109165422.311089-1-s.ivanov@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.340 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% 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 URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [plugin.data, acme.rs] Subject: [pbs-devel] [PATCH proxmox-backup 1/6] api: config: acme: rustfmt 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: , X-List-Received-Date: Tue, 09 Nov 2021 16:59:33 -0000 Signed-off-by: Stoiko Ivanov --- src/api2/config/acme.rs | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/src/api2/config/acme.rs b/src/api2/config/acme.rs index c24c7850..7ed55a75 100644 --- a/src/api2/config/acme.rs +++ b/src/api2/config/acme.rs @@ -10,7 +10,7 @@ use serde::{Deserialize, Serialize}; use serde_json::{json, Value}; use proxmox_router::{ - http_bail, list_subdirs_api_method, Permission, Router, SubdirMap, RpcEnvironment, + http_bail, list_subdirs_api_method, Permission, Router, RpcEnvironment, SubdirMap, }; use proxmox_schema::api; @@ -336,7 +336,8 @@ pub fn deactivate_account( task_warn!( worker, "error deactivating account {}, proceedeing anyway - {}", - name, err, + name, + err, ); } } @@ -630,7 +631,7 @@ pub fn delete_plugin(id: String) -> Result<(), Error> { #[api()] #[derive(Serialize, Deserialize)] -#[serde(rename_all="kebab-case")] +#[serde(rename_all = "kebab-case")] #[allow(non_camel_case_types)] /// Deletable property name pub enum DeletableProperty { @@ -709,16 +710,27 @@ pub fn update_plugin( if let Some(delete) = delete { for delete_prop in delete { match delete_prop { - DeletableProperty::validation_delay => { plugin.core.validation_delay = None; }, - DeletableProperty::disable => { plugin.core.disable = None; }, + DeletableProperty::validation_delay => { + plugin.core.validation_delay = None; + } + DeletableProperty::disable => { + plugin.core.disable = None; + } } } } - if let Some(data) = data { plugin.data = data; } - if let Some(api) = update.api { plugin.core.api = api; } - if update.validation_delay.is_some() { plugin.core.validation_delay = update.validation_delay; } - if update.disable.is_some() { plugin.core.disable = update.disable; } - + if let Some(data) = data { + plugin.data = data; + } + if let Some(api) = update.api { + plugin.core.api = api; + } + if update.validation_delay.is_some() { + plugin.core.validation_delay = update.validation_delay; + } + if update.disable.is_some() { + plugin.core.disable = update.disable; + } *entry = serde_json::to_value(plugin)?; } -- 2.30.2