[pbs-devel] [PATCH proxmox 04/12] subscription: remove lazy_static dependency

Maximiliano Sandoval m.sandoval at proxmox.com
Tue Aug 13 12:57:01 CEST 2024


Signed-off-by: Maximiliano Sandoval <m.sandoval at proxmox.com>
---
 proxmox-subscription/Cargo.toml     | 2 +-
 proxmox-subscription/debian/control | 2 --
 proxmox-subscription/src/check.rs   | 8 ++++----
 3 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/proxmox-subscription/Cargo.toml b/proxmox-subscription/Cargo.toml
index 4ec37d4c..38fc8e22 100644
--- a/proxmox-subscription/Cargo.toml
+++ b/proxmox-subscription/Cargo.toml
@@ -6,6 +6,7 @@ edition.workspace = true
 license.workspace = true
 repository.workspace = true
 description = "Proxmox subscription utilitites"
+rust-version.workspace = true
 
 exclude.workspace = true
 
@@ -13,7 +14,6 @@ exclude.workspace = true
 anyhow.workspace = true
 base64.workspace = true
 hex.workspace = true
-lazy_static.workspace = true
 openssl.workspace = true
 regex.workspace = true
 serde.workspace = true
diff --git a/proxmox-subscription/debian/control b/proxmox-subscription/debian/control
index 9fda03e1..f6c2a71d 100644
--- a/proxmox-subscription/debian/control
+++ b/proxmox-subscription/debian/control
@@ -9,7 +9,6 @@ Build-Depends: debhelper (>= 12),
  librust-anyhow-1+default-dev <!nocheck>,
  librust-base64-0.13+default-dev <!nocheck>,
  librust-hex-0.4+default-dev <!nocheck>,
- librust-lazy-static-1+default-dev (>= 1.4-~~) <!nocheck>,
  librust-openssl-0.10+default-dev <!nocheck>,
  librust-proxmox-http-0.9+client-trait-dev (>= 0.9.2-~~) <!nocheck>,
  librust-proxmox-http-0.9+default-dev (>= 0.9.2-~~) <!nocheck>,
@@ -36,7 +35,6 @@ Depends:
  librust-anyhow-1+default-dev,
  librust-base64-0.13+default-dev,
  librust-hex-0.4+default-dev,
- librust-lazy-static-1+default-dev (>= 1.4-~~),
  librust-openssl-0.10+default-dev,
  librust-proxmox-http-0.9+client-trait-dev (>= 0.9.2-~~),
  librust-proxmox-http-0.9+default-dev (>= 0.9.2-~~),
diff --git a/proxmox-subscription/src/check.rs b/proxmox-subscription/src/check.rs
index 0ef6f046..8522bcd3 100644
--- a/proxmox-subscription/src/check.rs
+++ b/proxmox-subscription/src/check.rs
@@ -1,6 +1,7 @@
+use std::sync::LazyLock;
+
 use anyhow::{bail, format_err, Error};
 
-use lazy_static::lazy_static;
 use regex::Regex;
 use serde_json::json;
 
@@ -11,9 +12,8 @@ use crate::{
     SubscriptionInfo, SubscriptionStatus,
 };
 
-lazy_static! {
-    static ref ATTR_RE: Regex = Regex::new(r"<([^>]+)>([^<]+)</[^>]+>").unwrap();
-}
+static ATTR_RE: LazyLock<Regex> =
+    LazyLock::new(|| Regex::new(r"<([^>]+)>([^<]+)</[^>]+>").unwrap());
 
 const SHOP_URI: &str = "https://shop.proxmox.com/modules/servers/licensing/verify.php";
 
-- 
2.39.2





More information about the pbs-devel mailing list