Skip to content

Commit 79c3bcd

Browse files
authored
refactor: Make once_cell optional (#89)
2 parents b5255fa + 3c60e7a commit 79c3bcd

9 files changed

Lines changed: 25 additions & 16 deletions

File tree

Cargo.lock

Lines changed: 11 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/libtest2-mimic/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ libtest2-harness = { version = "0.1.0", path = "../libtest2-harness" }
3636
cmd = "0.0.0"
3737
dunce = "1.0.4"
3838
escargot = "0.5.8"
39-
once_cell = "1.19.0"
39+
once_cell_polyfill = "1.56.0"
4040
pathdiff = "0.2.1"
4141
snapbox = "0.5.0"
4242

crates/libtest2-mimic/tests/testsuite/all_passing.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
fn test_cmd() -> snapbox::cmd::Command {
2-
static BIN: once_cell::sync::OnceCell<(std::path::PathBuf, std::path::PathBuf)> =
3-
once_cell::sync::OnceCell::new();
2+
static BIN: once_cell_polyfill::sync::OnceLock<(std::path::PathBuf, std::path::PathBuf)> =
3+
once_cell_polyfill::sync::OnceLock::new();
44
let (bin, current_dir) = BIN.get_or_init(|| {
55
let package_root = crate::util::new_test(
66
r#"

crates/libtest2-mimic/tests/testsuite/mixed_bag.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
fn test_cmd() -> snapbox::cmd::Command {
2-
static BIN: once_cell::sync::OnceCell<(std::path::PathBuf, std::path::PathBuf)> =
3-
once_cell::sync::OnceCell::new();
2+
static BIN: once_cell_polyfill::sync::OnceLock<(std::path::PathBuf, std::path::PathBuf)> =
3+
once_cell_polyfill::sync::OnceLock::new();
44
let (bin, current_dir) = BIN.get_or_init(|| {
55
let package_root = crate::util::new_test(
66
r#"

crates/libtest2-mimic/tests/testsuite/panic.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
fn test_cmd() -> snapbox::cmd::Command {
2-
static BIN: once_cell::sync::OnceCell<(std::path::PathBuf, std::path::PathBuf)> =
3-
once_cell::sync::OnceCell::new();
2+
static BIN: once_cell_polyfill::sync::OnceLock<(std::path::PathBuf, std::path::PathBuf)> =
3+
once_cell_polyfill::sync::OnceLock::new();
44
let (bin, current_dir) = BIN.get_or_init(|| {
55
let package_root = crate::util::new_test(
66
r#"

crates/libtest2/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ libtest2-harness = { version = "0.1.0", path = "../libtest2-harness" }
3636
cmd = "0.0.0"
3737
dunce = "1.0.4"
3838
escargot = "0.5.8"
39-
once_cell = "1.19.0"
39+
once_cell_polyfill = "1.56.0"
4040
pathdiff = "0.2.1"
4141
snapbox = "0.5.0"
4242

crates/libtest2/tests/testsuite/all_passing.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
fn test_cmd() -> snapbox::cmd::Command {
2-
static BIN: once_cell::sync::OnceCell<(std::path::PathBuf, std::path::PathBuf)> =
3-
once_cell::sync::OnceCell::new();
2+
static BIN: once_cell_polyfill::sync::OnceLock<(std::path::PathBuf, std::path::PathBuf)> =
3+
once_cell_polyfill::sync::OnceLock::new();
44
let (bin, current_dir) = BIN.get_or_init(|| {
55
let package_root = crate::util::new_test(
66
r#"

crates/libtest2/tests/testsuite/mixed_bag.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
fn test_cmd() -> snapbox::cmd::Command {
2-
static BIN: once_cell::sync::OnceCell<(std::path::PathBuf, std::path::PathBuf)> =
3-
once_cell::sync::OnceCell::new();
2+
static BIN: once_cell_polyfill::sync::OnceLock<(std::path::PathBuf, std::path::PathBuf)> =
3+
once_cell_polyfill::sync::OnceLock::new();
44
let (bin, current_dir) = BIN.get_or_init(|| {
55
let package_root = crate::util::new_test(
66
r#"

crates/libtest2/tests/testsuite/panic.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
fn test_cmd() -> snapbox::cmd::Command {
2-
static BIN: once_cell::sync::OnceCell<(std::path::PathBuf, std::path::PathBuf)> =
3-
once_cell::sync::OnceCell::new();
2+
static BIN: once_cell_polyfill::sync::OnceLock<(std::path::PathBuf, std::path::PathBuf)> =
3+
once_cell_polyfill::sync::OnceLock::new();
44
let (bin, current_dir) = BIN.get_or_init(|| {
55
let package_root = crate::util::new_test(
66
r#"

0 commit comments

Comments
 (0)