mirror of
https://github.com/LukeMathWalker/zero-to-production.git
synced 2024-12-02 14:16:35 +00:00
Remove once_cell
This commit is contained in:
parent
d5b9cea659
commit
9130cc3043
3 changed files with 3 additions and 5 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
@ -3366,7 +3366,6 @@ dependencies = [
|
|||
"fake",
|
||||
"linkify",
|
||||
"log",
|
||||
"once_cell",
|
||||
"quickcheck",
|
||||
"quickcheck_macros",
|
||||
"rand 0.8.5",
|
||||
|
|
|
@ -54,4 +54,3 @@ serde_json = "1.0.61"
|
|||
linkify = "0.10"
|
||||
claims = "0.7"
|
||||
reqwest = { version = "0.12", features = ["json"] }
|
||||
once_cell = "1.7.2"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
use once_cell::sync::Lazy;
|
||||
use sqlx::{Connection, Executor, PgConnection, PgPool};
|
||||
use std::sync::LazyLock;
|
||||
use uuid::Uuid;
|
||||
use wiremock::MockServer;
|
||||
use zero2prod::configuration::{get_configuration, DatabaseSettings};
|
||||
|
@ -7,7 +7,7 @@ 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() {
|
||||
|
@ -78,7 +78,7 @@ impl TestApp {
|
|||
}
|
||||
|
||||
pub async fn spawn_app() -> TestApp {
|
||||
Lazy::force(&TRACING);
|
||||
LazyLock::force(&TRACING);
|
||||
|
||||
// Launch a mock server to stand in for Postmark's API
|
||||
let email_server = MockServer::start().await;
|
||||
|
|
Loading…
Reference in a new issue