refactor: remove once_cell dependency

This commit is contained in:
Nova
2025-02-24 14:56:37 -08:00
parent 779706d792
commit 30a05a3218
16 changed files with 144 additions and 150 deletions

View File

@@ -1,14 +1,13 @@
use once_cell::sync::Lazy;
use parking_lot::Mutex;
use std::any::Any;
use std::{any::Any, sync::LazyLock};
use tokio::sync::mpsc::{self, unbounded_channel};
type Anything = Box<dyn Any + Send + Sync>;
static MAIN_DESTROY_QUEUE: Lazy<(
static MAIN_DESTROY_QUEUE: LazyLock<(
mpsc::UnboundedSender<Anything>,
Mutex<mpsc::UnboundedReceiver<Anything>>,
)> = Lazy::new(|| {
)> = LazyLock::new(|| {
let (tx, rx) = unbounded_channel();
(tx, Mutex::new(rx))
});