Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): replace once_cell with std::sync #158

Merged
merged 1 commit into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ name = "soldeer"
readme = "./README.md"
repository = "https://github.com/mario-eth/soldeer"
version = "0.3.0"
rust-version = "1.80"

[dependencies]
chrono = { version = "0.4.38", default-features = false, features = [
Expand All @@ -22,7 +23,6 @@ const-hex = "1.12.0"
email-address-parser = "2.0.0"
futures = "0.3.30"
ignore = { version = "0.4.22", features = ["simd-accel"] }
once_cell = "1.19"
regex = "1.10.5"
reqwest = { version = "0.12.5", features = [
"blocking",
Expand Down
1 change: 1 addition & 0 deletions clippy.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
msrv = "1.80"
18 changes: 9 additions & 9 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ use config::{
use dependency_downloader::download_dependency;
use janitor::cleanup_dependency;
use lock::LockWriteMode;
use once_cell::sync::Lazy;
use remote::get_latest_forge_std_dependency;
use std::{env, path::PathBuf};
use std::{env, path::PathBuf, sync::LazyLock};
use utils::{get_url_type, UrlType};
use versioning::validate_name;
use yansi::Paint as _;
Expand All @@ -37,13 +36,14 @@ mod remote;
mod utils;
mod versioning;

pub static DEPENDENCY_DIR: Lazy<PathBuf> =
Lazy::new(|| get_current_working_dir().join("dependencies/"));
pub static LOCK_FILE: Lazy<PathBuf> = Lazy::new(|| get_current_working_dir().join("soldeer.lock"));
pub static SOLDEER_CONFIG_FILE: Lazy<PathBuf> =
Lazy::new(|| get_current_working_dir().join("soldeer.toml"));
pub static FOUNDRY_CONFIG_FILE: Lazy<PathBuf> =
Lazy::new(|| get_current_working_dir().join("foundry.toml"));
pub static DEPENDENCY_DIR: LazyLock<PathBuf> =
LazyLock::new(|| get_current_working_dir().join("dependencies/"));
pub static LOCK_FILE: LazyLock<PathBuf> =
LazyLock::new(|| get_current_working_dir().join("soldeer.lock"));
pub static SOLDEER_CONFIG_FILE: LazyLock<PathBuf> =
LazyLock::new(|| get_current_working_dir().join("soldeer.toml"));
pub static FOUNDRY_CONFIG_FILE: LazyLock<PathBuf> =
LazyLock::new(|| get_current_working_dir().join("foundry.toml"));

#[tokio::main]
pub async fn run(command: Subcommands) -> Result<(), SoldeerError> {
Expand Down
7 changes: 3 additions & 4 deletions src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use crate::{
config::HttpDependency, dependency_downloader::IntegrityChecksum, errors::DownloadError,
};
use ignore::{WalkBuilder, WalkState};
use once_cell::sync::Lazy;
use regex::Regex;
use sha2::{Digest, Sha256};
use simple_home_dir::home_dir;
Expand All @@ -14,15 +13,15 @@ use std::{
path::{Path, PathBuf},
sync::{
atomic::{AtomicBool, Ordering},
Arc, Mutex,
Arc, LazyLock, Mutex,
},
};
use yansi::Paint as _;

static GIT_SSH_REGEX: Lazy<Regex> = Lazy::new(|| {
static GIT_SSH_REGEX: LazyLock<Regex> = LazyLock::new(|| {
Regex::new(r"^(?:git@github\.com|git@gitlab)").expect("git ssh regex should compile")
});
static GIT_HTTPS_REGEX: Lazy<Regex> = Lazy::new(|| {
static GIT_HTTPS_REGEX: LazyLock<Regex> = LazyLock::new(|| {
Regex::new(r"^(?:https://github\.com|https://gitlab\.com).*\.git$")
.expect("git https regex should compile")
});
Expand Down