From 04536725c2ea16329e84bcfe3200afd47eeeb464 Mon Sep 17 00:00:00 2001 From: acheron <98934430+acheroncrypto@users.noreply.github.com> Date: Tue, 26 Nov 2024 20:24:05 +0100 Subject: [PATCH] avm: Remove `once_cell` dependency (#3385) --- Cargo.lock | 1 - avm/Cargo.toml | 1 - avm/src/lib.rs | 4 ++-- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4224183ba3..5ce5100ad8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -660,7 +660,6 @@ dependencies = [ "clap 4.5.17", "clap_complete", "dirs", - "once_cell", "reqwest", "semver", "serde", diff --git a/avm/Cargo.toml b/avm/Cargo.toml index 6e449b9766..c238ce100d 100644 --- a/avm/Cargo.toml +++ b/avm/Cargo.toml @@ -19,7 +19,6 @@ chrono = "0.4" clap = { version = "4.5.17", features = ["derive"] } clap_complete = "4.5.26" dirs = "4.0.0" -once_cell = "1.8.0" reqwest = { version = "0.11.9", default-features = false, features = ["blocking", "json", "rustls-tls"] } semver = "1.0.4" serde = { version = "1.0.136", features = ["derive"] } diff --git a/avm/src/lib.rs b/avm/src/lib.rs index 252a406084..5648d6336a 100644 --- a/avm/src/lib.rs +++ b/avm/src/lib.rs @@ -1,7 +1,6 @@ use anyhow::{anyhow, Error, Result}; use cargo_toml::Manifest; use chrono::{TimeZone, Utc}; -use once_cell::sync::Lazy; use reqwest::header::USER_AGENT; use reqwest::StatusCode; use semver::{Prerelease, Version}; @@ -10,9 +9,10 @@ use std::fs; use std::io::{BufRead, Write}; use std::path::PathBuf; use std::process::{Command, Stdio}; +use std::sync::LazyLock; /// Storage directory for AVM, customizable by setting the $AVM_HOME, defaults to ~/.avm -pub static AVM_HOME: Lazy = Lazy::new(|| { +pub static AVM_HOME: LazyLock = LazyLock::new(|| { cfg_if::cfg_if! { if #[cfg(test)] { let dir = tempfile::tempdir().expect("Could not create temporary directory");