diff --git a/Cargo.lock b/Cargo.lock index ca8cfe9..b8e942b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -648,12 +648,6 @@ dependencies = [ "simple_asn1", ] -[[package]] -name = "lazy_static" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" - [[package]] name = "libc" version = "0.2.155" @@ -858,7 +852,6 @@ dependencies = [ "anyhow", "clap", "git2", - "lazy_static", "octocrab", "serde", "serde_yml", diff --git a/Cargo.toml b/Cargo.toml index a0a8632..0e14692 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,6 @@ edition = "2021" anyhow = "^1" clap = { version = "^4", features = ["derive", "env"] } git2 = "^0" -lazy_static = "^1" octocrab = "^0" serde = "^1" serde_yml = "^0" diff --git a/src/main.rs b/src/main.rs index 6ce7abd..d9943fb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -5,6 +5,7 @@ mod helm_config; mod repo; mod util; +use std::sync::LazyLock; use std::{env, str}; use anyhow::{anyhow, Context}; @@ -13,17 +14,16 @@ use clap::builder::styling::Style; use clap::{Parser, Subcommand}; use git2::Repository; use helm_config::ImageRefs; -use lazy_static::lazy_static; use octocrab::Octocrab; const BOLD_UNDERLINE: Style = Style::new().bold().underline(); -lazy_static! { - static ref GITHUB_TOKEN_HELP: String = format!( +static GITHUB_TOKEN_HELP: LazyLock = LazyLock::new(|| { + format!( "{BOLD_UNDERLINE}Environment variables:{BOLD_UNDERLINE:#} GITHUB_TOKEN GitHub token to use for API requests " - ); -} + ) +}); /// Program to simplify PCI double approval process across repositories #[derive(Parser)] diff --git a/src/util.rs b/src/util.rs index bef70a3..cea9f14 100644 --- a/src/util.rs +++ b/src/util.rs @@ -2,6 +2,7 @@ use anyhow::Context; use url::Url; #[derive(Clone, Debug)] +#[allow(dead_code)] pub struct Remote { pub host: url::Host, pub port: u16,