diff --git a/Cargo.lock b/Cargo.lock index d4d3428..9573303 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3349,7 +3349,6 @@ dependencies = [ "config", "fake", "log", - "once_cell", "quickcheck", "quickcheck_macros", "reqwest", diff --git a/Cargo.toml b/Cargo.toml index 675e867..3f13f34 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -50,4 +50,3 @@ wiremock = "0.6" serde_json = "1.0.61" claims = "0.7" reqwest = { version = "0.12", features = ["json"] } -once_cell = "1.7.2" diff --git a/tests/api/helpers.rs b/tests/api/helpers.rs index b0c49c1..e28b5a7 100644 --- a/tests/api/helpers.rs +++ b/tests/api/helpers.rs @@ -1,12 +1,12 @@ -use once_cell::sync::Lazy; use sqlx::{Connection, Executor, PgConnection, PgPool}; +use std::sync::LazyLock; use uuid::Uuid; use zero2prod::configuration::{get_configuration, DatabaseSettings}; use zero2prod::startup::{get_connection_pool, Application}; 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() { @@ -36,7 +36,7 @@ impl TestApp { } pub async fn spawn_app() -> TestApp { - Lazy::force(&TRACING); + LazyLock::force(&TRACING); // Randomise configuration to ensure test isolation let configuration = {