diff --git a/.ci/cargo-ci/Cargo.toml b/.ci/cargo-ci/Cargo.toml index 1f488d83..52a2a0ca 100644 --- a/.ci/cargo-ci/Cargo.toml +++ b/.ci/cargo-ci/Cargo.toml @@ -14,7 +14,6 @@ clap = { workspace = true, features = ["derive", "string"] } flate2 = { workspace = true } fs-err = { workspace = true } fs_extra = { workspace = true } -lazy_static = { workspace = true } predicates = { workspace = true } reqwest = { workspace = true, features = ["blocking"] } shadow-rs = { workspace = true } diff --git a/.ci/cargo-ci/src/core/constants.rs b/.ci/cargo-ci/src/core/constants.rs index a2a9df7d..5b3c43a5 100644 --- a/.ci/cargo-ci/src/core/constants.rs +++ b/.ci/cargo-ci/src/core/constants.rs @@ -1,20 +1,19 @@ -use std::path::{PathBuf, Path}; +use std::path::{Path, PathBuf}; +use std::sync::LazyLock; -use lazy_static::lazy_static; +static WORKSPACE_DIR: LazyLock = LazyLock::new(|| { + let output = std::process::Command::new(env!("CARGO")) + .arg("locate-project") + .arg("--workspace") + .arg("--message-format=plain") + .output() + .unwrap() + .stdout; -lazy_static! { - static ref WORKSPACE_DIR: PathBuf = { - let output = std::process::Command::new(env!("CARGO")) - .arg("locate-project") - .arg("--workspace") - .arg("--message-format=plain") - .output() - .unwrap() - .stdout; - let cargo_path = Path::new(std::str::from_utf8(&output).unwrap().trim()); - cargo_path.parent().unwrap().to_path_buf() - }; -} + let cargo_path = Path::new(std::str::from_utf8(&output).unwrap().trim()); + + cargo_path.parent().unwrap().to_path_buf() +}); /// The root of the Cargo Workspace. Should be the repository root. pub fn workspace_dir() -> PathBuf { diff --git a/.ci/cargo-ci/src/core/metadata.rs b/.ci/cargo-ci/src/core/metadata.rs index 25fe647b..892d0f78 100644 --- a/.ci/cargo-ci/src/core/metadata.rs +++ b/.ci/cargo-ci/src/core/metadata.rs @@ -1,14 +1,12 @@ +use std::sync::LazyLock; use cargo_metadata::Package; -use lazy_static::lazy_static; -lazy_static! { - static ref CARGO_METADATA: cargo_metadata::Metadata = { - cargo_metadata::MetadataCommand::new() - .manifest_path(crate::constants::workspace_dir().join("Cargo.toml")) - .exec() - .expect("Failed to gather Cargo metadata.") - }; -} +static CARGO_METADATA: LazyLock = LazyLock::new(|| + cargo_metadata::MetadataCommand::new() + .manifest_path(crate::constants::workspace_dir().join("Cargo.toml")) + .exec() + .expect("Failed to gather Cargo metadata.") +); pub fn cargo() -> cargo_metadata::Metadata { CARGO_METADATA.to_owned() diff --git a/Cargo.lock b/Cargo.lock index 291234c8..5a34130d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3878,7 +3878,6 @@ dependencies = [ "flate2", "fs-err", "fs_extra", - "lazy_static", "predicates", "reqwest 0.12.9", "serde-spdx", diff --git a/Cargo.toml b/Cargo.toml index dd6362f9..659690f8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,7 +24,7 @@ resolver = "2" [workspace.package] version = "0.5.0-alpha" edition = "2021" -rust-version = "1.78" +rust-version = "1.80" license = "Apache-2.0" repository = "https://github.com/eclipse-opendut/opendut" @@ -89,7 +89,6 @@ hyper-util = "0.1.6" indicatif = "0.17.7" indoc = "2.0.4" jsonwebtoken = "9.2.0" -lazy_static = "1.4.0" leptos = { version = "0.6.15" } leptos_oidc = { version = "0.4.0" } leptos_router = { version = "0.6.15" }