diff --git a/Cargo.lock b/Cargo.lock index 2c261a7..985c715 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3054,7 +3054,6 @@ dependencies = [ "claims", "config", "log", - "once_cell", "reqwest", "secrecy", "serde", diff --git a/Cargo.toml b/Cargo.toml index 35ed29e..fe48ba0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,4 +40,3 @@ secrecy = { version = "0.8", features = ["serde"] } [dev-dependencies] claims = "0.7" reqwest = { version = "0.12", features = ["json"] } -once_cell = "1.7.2" diff --git a/tests/health_check.rs b/tests/health_check.rs index 4ff3f1a..20fba74 100644 --- a/tests/health_check.rs +++ b/tests/health_check.rs @@ -1,13 +1,13 @@ -use once_cell::sync::Lazy; use sqlx::{Connection, Executor, PgConnection, PgPool}; use std::net::TcpListener; +use std::sync::LazyLock; use uuid::Uuid; use zero2prod::configuration::{get_configuration, DatabaseSettings}; use zero2prod::startup::run; use zero2prod::telemetry::{get_subscriber, init_subscriber}; // Ensure that the `tracing` stack is only initialised once using `once_cell` -static TRACING: Lazy<()> = Lazy::new(|| { +static TRACING: LazyLock<()> = LazyLock::new(|| { let default_filter_level = "info".to_string(); let subscriber_name = "test".to_string(); if std::env::var("TEST_LOG").is_ok() { @@ -27,7 +27,7 @@ pub struct TestApp { async fn spawn_app() -> TestApp { // The first time `initialize` is invoked the code in `TRACING` is executed. // All other invocations will instead skip execution. - Lazy::force(&TRACING); + LazyLock::force(&TRACING); let listener = TcpListener::bind("127.0.0.1:0").expect("Failed to bind random port"); // We retrieve the port assigned to us by the OS