Skip to content

Commit

Permalink
[meta] remove direct dep on once_cell (#2123)
Browse files Browse the repository at this point in the history
`Lazy` is now in Rust 1.80+ as `LazyLock`, so switch to that.
  • Loading branch information
sunshowers authored Feb 6, 2025
1 parent d2ca6b4 commit c872a3b
Show file tree
Hide file tree
Showing 15 changed files with 218 additions and 212 deletions.
3 changes: 0 additions & 3 deletions Cargo.lock

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

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ nextest-metadata = { version = "0.12.1", path = "nextest-metadata" }
nextest-workspace-hack = "0.1.0"
nix = { version = "0.29.0", default-features = false, features = ["signal"] }
num_threads = "0.1.7"
once_cell = "1.20.2"
owo-colors = "4.1.0"
pathdiff = { version = "0.2.3", features = ["camino"] }
pin-project-lite = "0.2.16"
Expand Down
1 change: 0 additions & 1 deletion cargo-nextest/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ nextest-filtering = { version = "=0.13.0", path = "../nextest-filtering" }
nextest-metadata = { version = "=0.12.1", path = "../nextest-metadata" }
nextest-runner = { version = "=0.71.0", path = "../nextest-runner" }
nextest-workspace-hack.workspace = true
once_cell.workspace = true
owo-colors.workspace = true
pathdiff.workspace = true
quick-junit.workspace = true
Expand Down
11 changes: 5 additions & 6 deletions cargo-nextest/src/dispatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ use nextest_runner::{
write_str::WriteStr,
RustcCli,
};
use once_cell::sync::OnceCell;
use owo_colors::OwoColorize;
use quick_junit::XmlString;
use semver::Version;
Expand All @@ -53,7 +52,7 @@ use std::{
env::VarError,
fmt,
io::{Cursor, Write},
sync::Arc,
sync::{Arc, OnceLock},
};
use swrite::{swrite, SWrite};
use tracing::{debug, info, warn, Level};
Expand Down Expand Up @@ -1133,8 +1132,8 @@ struct BaseApp {
current_version: Version,

cargo_configs: CargoConfigs,
double_spawn: OnceCell<DoubleSpawnInfo>,
target_runner: OnceCell<TargetRunner>,
double_spawn: OnceLock<DoubleSpawnInfo>,
target_runner: OnceLock<TargetRunner>,
}

impl BaseApp {
Expand Down Expand Up @@ -1235,8 +1234,8 @@ impl BaseApp {
cargo_configs,
current_version,

double_spawn: OnceCell::new(),
target_runner: OnceCell::new(),
double_spawn: OnceLock::new(),
target_runner: OnceLock::new(),
})
}

Expand Down
5 changes: 2 additions & 3 deletions cargo-nextest/src/version.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// Copyright (c) The nextest Contributors
// SPDX-License-Identifier: MIT OR Apache-2.0

use once_cell::sync::Lazy;
use std::fmt::Write;
use std::{fmt::Write, sync::LazyLock};

pub(crate) fn short() -> &'static str {
&VERSION_INFO.short
Expand All @@ -13,7 +12,7 @@ pub(crate) fn long() -> &'static str {
}

// All the data here is static so we can use a singleton.
static VERSION_INFO: Lazy<VersionInfo> = Lazy::new(|| {
static VERSION_INFO: LazyLock<VersionInfo> = LazyLock::new(|| {
let inner = VersionInfoInner::new();
let short = inner.to_short();
let long = inner.to_long();
Expand Down
1 change: 0 additions & 1 deletion fixture-data/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ publish = false
maplit.workspace = true
nextest-metadata.workspace = true
nextest-workspace-hack.workspace = true
once_cell.workspace = true
Loading

0 comments on commit c872a3b

Please sign in to comment.