From: Maximiliano Sandoval <m.sandoval@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH offline-mirror] remove lazy_static dependency
Date: Tue, 13 Aug 2024 13:02:27 +0200 [thread overview]
Message-ID: <20240813110227.329109-1-m.sandoval@proxmox.com> (raw)
Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
---
Cargo.toml | 3 +--
debian/control | 1 -
src/config.rs | 6 ++----
3 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/Cargo.toml b/Cargo.toml
index 781121f..21e9487 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -5,7 +5,7 @@ authors = ["Proxmox Support Team <support@proxmox.com>"]
edition = "2021"
license = "AGPL-3"
description = "Proxmox offline repository mirror and subscription key manager"
-rust-version = "1.70"
+rust-version = "1.80"
exclude = ["debian"]
@@ -16,7 +16,6 @@ bzip2 = "0.4"
flate2 = "1.0.22"
globset = "0.4.8"
hex = "0.4.3"
-lazy_static = "1.4"
nix = "0.26.1"
openssl = "0.10"
regex = "1.5.5"
diff --git a/debian/control b/debian/control
index edf88dc..f2353ff 100644
--- a/debian/control
+++ b/debian/control
@@ -14,7 +14,6 @@ Build-Depends: bash-completion,
librust-flate2-1+default-dev (>= 1.0.22-~~),
librust-globset-0.4+default-dev (>= 0.4.8-~~),
librust-hex-0.4+default-dev (>= 0.4.3-~~),
- librust-lazy-static-1+default-dev (>= 1.4-~~),
librust-nix-0.26+default-dev (>= 0.26.1-~~),
librust-openssl-0.10+default-dev,
librust-proxmox-apt-api-types-dev,
diff --git a/src/config.rs b/src/config.rs
index 9c75717..eb69a6b 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -1,7 +1,7 @@
use std::path::Path;
+use std::sync::LazyLock;
use anyhow::{bail, Error};
-use lazy_static::lazy_static;
use proxmox_subscription::{sign::ServerBlob, SubscriptionInfo};
use serde::{Deserialize, Serialize};
@@ -261,9 +261,7 @@ impl SubscriptionKey {
}
}
-lazy_static! {
- pub static ref CONFIG: SectionConfig = init();
-}
+pub static CONFIG: LazyLock<SectionConfig> = LazyLock::new(init);
fn init() -> SectionConfig {
let mut config = SectionConfig::new(&MIRROR_ID_SCHEMA);
--
2.39.2
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
reply other threads:[~2024-08-13 11:02 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240813110227.329109-1-m.sandoval@proxmox.com \
--to=m.sandoval@proxmox.com \
--cc=pbs-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.