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 4E5F095A6A for ; Wed, 28 Feb 2024 10:55:29 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 28A938A95 for ; Wed, 28 Feb 2024 10:54:59 +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 ; Wed, 28 Feb 2024 10:54:58 +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 509E147B1F for ; Wed, 28 Feb 2024 10:54:58 +0100 (CET) From: Maximiliano Sandoval To: pbs-devel@lists.proxmox.com Date: Wed, 28 Feb 2024 10:54:56 +0100 Message-Id: <20240228095456.159111-1-m.sandoval@proxmox.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.018 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. [formatter.rs] Subject: [pbs-devel] [PATCH proxmox] subscription: Use const rather than static 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: Wed, 28 Feb 2024 09:55:29 -0000 A static is like a const that can mutate, we don't need that. Signed-off-by: Maximiliano Sandoval --- proxmox-rest-server/src/formatter.rs | 2 +- proxmox-subscription/src/subscription_info.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/proxmox-rest-server/src/formatter.rs b/proxmox-rest-server/src/formatter.rs index d19d6805..b9ed3bce 100644 --- a/proxmox-rest-server/src/formatter.rs +++ b/proxmox-rest-server/src/formatter.rs @@ -41,7 +41,7 @@ pub trait OutputFormatter: Send + Sync { } } -static JSON_CONTENT_TYPE: &str = "application/json;charset=UTF-8"; +const JSON_CONTENT_TYPE: &str = "application/json;charset=UTF-8"; fn json_data_response(data: Value) -> Response { let json_str = data.to_string(); diff --git a/proxmox-subscription/src/subscription_info.rs b/proxmox-subscription/src/subscription_info.rs index ae40dbff..c2e3e7ea 100644 --- a/proxmox-subscription/src/subscription_info.rs +++ b/proxmox-subscription/src/subscription_info.rs @@ -302,7 +302,7 @@ pub(crate) fn md5sum(data: &[u8]) -> Result { /// Generate the current system's "server ID". pub fn get_hardware_address() -> Result { - static FILENAME: &str = "/etc/ssh/ssh_host_rsa_key.pub"; + const FILENAME: &str = "/etc/ssh/ssh_host_rsa_key.pub"; let contents = proxmox_sys::fs::file_get_contents(FILENAME) .map_err(|e| format_err!("Error getting host key - {}", e))?; -- 2.39.2