Skip to content

Commit 0215cdc

Browse files
committed
elegant-departure: removes lazy static dependency
1 parent 27c010e commit 0215cdc

2 files changed

Lines changed: 3 additions & 6 deletions

File tree

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ edition = "2021"
1010

1111

1212
[dependencies]
13-
lazy_static = "1"
1413
futures = "0.3"
1514
tokio-util = ">= 0.6, < 0.8"
1615
pin-project-lite = "0.2"

src/lib.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -197,14 +197,12 @@ pub mod tokio;
197197

198198
pub use registry::{ShutdownGuard, WaitForShutdownFuture};
199199

200-
use lazy_static::lazy_static;
201200
use std::future::Future;
202201
use std::pin::Pin;
203-
use std::sync::Mutex;
202+
use std::sync::{LazyLock, Mutex};
204203

205-
lazy_static! {
206-
static ref REGISTRY: Mutex<registry::Registry> = Mutex::new(registry::Registry::new());
207-
}
204+
static REGISTRY: LazyLock<Mutex<registry::Registry>> =
205+
LazyLock::new(|| Mutex::new(registry::Registry::new()));
208206

209207
pub(crate) type BoxFuture<T> = Pin<Box<dyn Future<Output = T> + Send>>;
210208

0 commit comments

Comments
 (0)