refactor: remove once_cell use from tinymist (#1632)

* refactor: remove `once_cell` use from tinymist

* feat: remove more
This commit is contained in:
Myriad-Dreamin 2025-04-08 02:11:44 +08:00 committed by GitHub
parent 769fc93df9
commit 72e33e461d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 68 additions and 82 deletions

View file

@ -19,7 +19,6 @@ comemo.workspace = true
reflexo-vec2svg.workspace = true
reflexo-typst.workspace = true
once_cell.workspace = true
tokio.workspace = true
env_logger.workspace = true
log.workspace = true

View file

@ -10,10 +10,10 @@ pub use actor::editor::{
pub use args::*;
pub use outline::Outline;
use std::sync::OnceLock;
use std::{collections::HashMap, future::Future, path::PathBuf, pin::Pin, sync::Arc};
use futures::sink::SinkExt;
use once_cell::sync::OnceCell;
use reflexo_typst::debug_loc::{DocumentPosition, SourceSpanOffset};
use reflexo_typst::Error;
use serde::{Deserialize, Serialize};
@ -197,7 +197,7 @@ pub struct PreviewBuilder {
webview_conn: BroadcastChannel<WebviewActorRequest>,
doc_sender: Arc<parking_lot::RwLock<Option<Arc<dyn CompileView>>>>,
compile_watcher: OnceCell<Arc<CompileWatcher>>,
compile_watcher: OnceLock<Arc<CompileWatcher>>,
}
impl PreviewBuilder {
@ -209,7 +209,7 @@ impl PreviewBuilder {
editor_conn: mpsc::unbounded_channel(),
webview_conn: broadcast::channel(32),
doc_sender: Arc::new(parking_lot::RwLock::new(None)),
compile_watcher: OnceCell::new(),
compile_watcher: OnceLock::new(),
}
}