From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 2F0E41FF169 for ; Wed, 14 Aug 2024 09:20:24 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 99F1CFE0E; Wed, 14 Aug 2024 09:20:39 +0200 (CEST) From: Maximiliano Sandoval To: pbs-devel@lists.proxmox.com Date: Wed, 14 Aug 2024 09:19:58 +0200 Message-Id: <20240814072001.53422-9-m.sandoval@proxmox.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240814072001.53422-1-m.sandoval@proxmox.com> References: <20240814072001.53422-1-m.sandoval@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.112 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 - Subject: [pbs-devel] [PATCH proxmox v2 09/12] auth-api: remove lazy_static dependency 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" Signed-off-by: Maximiliano Sandoval --- proxmox-auth-api/Cargo.toml | 4 ++-- proxmox-auth-api/src/types.rs | 11 ++++------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/proxmox-auth-api/Cargo.toml b/proxmox-auth-api/Cargo.toml index 44db2bf8..62c173ad 100644 --- a/proxmox-auth-api/Cargo.toml +++ b/proxmox-auth-api/Cargo.toml @@ -7,6 +7,7 @@ license.workspace = true repository.workspace = true exclude.workspace = true description = "Tickets, API and Realm handling" +rust-version.workspace = true [[example]] name = "passwd" @@ -16,7 +17,6 @@ required-features = [ "pam-authenticator" ] anyhow.workspace = true const_format = { workspace = true, optional = true } base64 = { workspace = true, optional = true } -lazy_static = { workspace = true, optional = true } libc = { workspace = true, optional = true } log = { workspace = true, optional = true } http = { workspace = true, optional = true } @@ -40,7 +40,7 @@ proxmox-tfa = { workspace = true, optional = true, features = [ "api" ] } default = [] ticket = [ "dep:base64", "dep:percent-encoding", "dep:openssl" ] -api-types = [ "dep:const_format", "dep:lazy_static", "dep:regex", "dep:serde", "dep:serde_plain", "dep:proxmox-schema" ] +api-types = [ "dep:const_format", "dep:regex", "dep:serde", "dep:serde_plain", "dep:proxmox-schema" ] api = [ "api-types", "ticket", diff --git a/proxmox-auth-api/src/types.rs b/proxmox-auth-api/src/types.rs index 25e5feff..64c580a5 100644 --- a/proxmox-auth-api/src/types.rs +++ b/proxmox-auth-api/src/types.rs @@ -23,10 +23,10 @@ use std::borrow::Borrow; use std::fmt; +use std::sync::LazyLock; use anyhow::{bail, format_err, Error}; use const_format::concatcp; -use lazy_static::lazy_static; use serde::{Deserialize, Serialize}; use proxmox_schema::{ @@ -454,9 +454,7 @@ impl Userid { } } -lazy_static! { - pub static ref ROOT_USERID: Userid = Userid::new("root@pam".to_string(), 4); -} +pub static ROOT_USERID: LazyLock = LazyLock::new(|| Userid::new("root@pam".to_string(), 4)); impl From for Userid { fn from(authid: Authid) -> Self { @@ -587,9 +585,8 @@ impl Authid { } } -lazy_static! { - pub static ref ROOT_AUTHID: Authid = Authid::from(Userid::new("root@pam".to_string(), 4)); -} +pub static ROOT_AUTHID: LazyLock = + LazyLock::new(|| Authid::from(Userid::new("root@pam".to_string(), 4))); impl From for Authid { fn from(parts: Userid) -> Self { -- 2.39.2 _______________________________________________ pbs-devel mailing list pbs-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel