diff --git a/integrations/axum/Cargo.toml b/integrations/axum/Cargo.toml index 58c7edfa2..5f2eddb5a 100644 --- a/integrations/axum/Cargo.toml +++ b/integrations/axum/Cargo.toml @@ -19,4 +19,5 @@ leptos_integration_utils = { workspace = true } serde_json = "1" tokio = { version = "1", features = ["full"] } parking_lot = "0.12.1" -tokio-util = {version = "0.7.7", features = ["rt"] } \ No newline at end of file +tokio-util = {version = "0.7.7", features = ["rt"] } +once_cell = "1.17" diff --git a/integrations/axum/src/lib.rs b/integrations/axum/src/lib.rs index 19cdb7c11..d7976fa7e 100644 --- a/integrations/axum/src/lib.rs +++ b/integrations/axum/src/lib.rs @@ -31,13 +31,9 @@ use leptos::{ use leptos_integration_utils::{build_async_response, html_parts_separated}; use leptos_meta::{generate_head_metadata_separated, MetaContext}; use leptos_router::*; +use once_cell::sync::OnceCell; use parking_lot::RwLock; -use std::{ - io, - pin::Pin, - sync::{Arc, OnceLock}, - thread::available_parallelism, -}; +use std::{io, pin::Pin, sync::Arc, thread::available_parallelism}; use tokio::task::LocalSet; use tokio_util::task::LocalPoolHandle; @@ -1193,7 +1189,7 @@ impl LeptosRoutes for axum::Router { } fn get_leptos_pool() -> LocalPoolHandle { - static LOCAL_POOL: OnceLock = OnceLock::new(); + static LOCAL_POOL: OnceCell = OnceCell::new(); LOCAL_POOL .get_or_init(|| { tokio_util::task::LocalPoolHandle::new(