From 621724fd9b6b92a049e614434b16e8faac0e9179 Mon Sep 17 00:00:00 2001 From: sxyazi Date: Tue, 31 Mar 2026 19:15:25 +0800 Subject: [PATCH] .. --- Cargo.lock | 42 ++------------------------ Cargo.toml | 1 - yazi-core/Cargo.toml | 3 -- yazi-dds/Cargo.toml | 1 - yazi-parser/Cargo.toml | 4 --- yazi-plugin/Cargo.toml | 5 --- yazi-proxy/Cargo.toml | 2 -- yazi-runner/README.md | 2 +- yazi-runner/src/previewer/previewer.rs | 15 +++------ yazi-scheduler/src/hook/in.rs | 2 +- yazi-scheduler/src/scheduler.rs | 2 +- 11 files changed, 10 insertions(+), 69 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 889aa490..75f6f0a0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3365,7 +3365,7 @@ dependencies = [ "kasuari", "lru", "serde", - "strum 0.27.2", + "strum", "thiserror 2.0.18", "unicode-segmentation", "unicode-truncate", @@ -3430,7 +3430,7 @@ dependencies = [ "line-clipping", "ratatui-core", "serde", - "strum 0.27.2", + "strum", "time", "unicode-segmentation", "unicode-width", @@ -4227,16 +4227,7 @@ version = "0.27.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af23d6f6c1a224baef9d3f61e287d2761385a5b88fdab4eb4c6f11aeb54c4bcf" dependencies = [ - "strum_macros 0.27.2", -] - -[[package]] -name = "strum" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9628de9b8791db39ceda2b119bbe13134770b56c138ec1d3af810d045c04f9bd" -dependencies = [ - "strum_macros 0.28.0", + "strum_macros", ] [[package]] @@ -4251,18 +4242,6 @@ dependencies = [ "syn 2.0.117", ] -[[package]] -name = "strum_macros" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab85eea0270ee17587ed4156089e10b9e6880ee688791d45a905f5b1ca36f664" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "syn 2.0.117", -] - [[package]] name = "subtle" version = "2.6.1" @@ -5748,16 +5727,13 @@ version = "26.2.2" dependencies = [ "anyhow", "crossterm 0.29.0", - "dyn-clone", "hashbrown 0.16.1", "indexmap 2.13.0", "mlua", - "ordered-float 5.2.0", "parking_lot", "ratatui", "serde", "serde_with", - "strum 0.28.0", "syntect", "tokio", "tokio-stream", @@ -5804,7 +5780,6 @@ dependencies = [ "yazi-fs", "yazi-macro", "yazi-shared", - "yazi-widgets", ] [[package]] @@ -5924,15 +5899,11 @@ dependencies = [ "anyhow", "bitflags 2.11.0", "crossterm 0.29.0", - "dyn-clone", "hashbrown 0.16.1", - "indexmap 2.13.0", "mlua", - "ordered-float 5.2.0", "paste", "ratatui", "serde", - "serde_with", "tokio", "yazi-binding", "yazi-boot", @@ -5955,17 +5926,13 @@ dependencies = [ "ansi-to-tui", "anyhow", "futures", - "hashbrown 0.16.1", "libc", "mlua", - "parking_lot", "paste", "ratatui", "serde_json", - "syntect", "tokio", "tokio-stream", - "tokio-util", "tracing", "twox-hash", "unicode-width", @@ -5980,7 +5947,6 @@ dependencies = [ "yazi-emulator", "yazi-fs", "yazi-macro", - "yazi-parser", "yazi-proxy", "yazi-runner", "yazi-scheduler", @@ -6001,9 +5967,7 @@ checksum = "33232d9116df6415ddfcdf72701b1b7439ce87f240a14723e8dd5d17e7ed5f98" name = "yazi-proxy" version = "26.2.2" dependencies = [ - "mlua", "tokio", - "yazi-binding", "yazi-config", "yazi-core", "yazi-macro", diff --git a/Cargo.toml b/Cargo.toml index 47a2026c..e0983998 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -67,7 +67,6 @@ scopeguard = "1.2.0" serde = { version = "1.0.228", features = [ "derive" ] } serde_json = "1.0.149" serde_with = "3.18.0" -strum = { version = "0.28.0", features = [ "derive" ] } syntect = { version = "5.3.0", default-features = false, features = [ "parsing", "plist-load", "regex-onig" ] } thiserror = "2.0.18" tokio = { version = "1.50.0", features = [ "full" ] } diff --git a/yazi-core/Cargo.toml b/yazi-core/Cargo.toml index c22ba48d..acd187c0 100644 --- a/yazi-core/Cargo.toml +++ b/yazi-core/Cargo.toml @@ -31,16 +31,13 @@ yazi-widgets = { path = "../yazi-widgets", version = "26.2.2" } # External dependencies anyhow = { workspace = true } crossterm = { workspace = true } -dyn-clone = { workspace = true } hashbrown = { workspace = true } indexmap = { workspace = true } mlua = { workspace = true } -ordered-float = { workspace = true } parking_lot = { workspace = true } ratatui = { workspace = true } serde = { workspace = true } serde_with = { workspace = true } -strum = { workspace = true } syntect = { workspace = true } tokio = { workspace = true } tokio-stream = { workspace = true } diff --git a/yazi-dds/Cargo.toml b/yazi-dds/Cargo.toml index 503d60e1..c4074ea8 100644 --- a/yazi-dds/Cargo.toml +++ b/yazi-dds/Cargo.toml @@ -22,7 +22,6 @@ yazi-boot = { path = "../yazi-boot", version = "26.2.2" } yazi-fs = { path = "../yazi-fs", version = "26.2.2" } yazi-macro = { path = "../yazi-macro", version = "26.2.2" } yazi-shared = { path = "../yazi-shared", version = "26.2.2" } -yazi-widgets = { path = "../yazi-widgets", version = "26.2.2" } # External dependencies anyhow = { workspace = true } diff --git a/yazi-parser/Cargo.toml b/yazi-parser/Cargo.toml index 93f518d6..e872ebdb 100644 --- a/yazi-parser/Cargo.toml +++ b/yazi-parser/Cargo.toml @@ -34,15 +34,11 @@ yazi-widgets = { path = "../yazi-widgets", version = "26.2.2" } anyhow = { workspace = true } bitflags = { workspace = true } crossterm = { workspace = true } -dyn-clone = { workspace = true } hashbrown = { workspace = true } -indexmap = { workspace = true } mlua = { workspace = true } -ordered-float = { workspace = true } paste = { workspace = true } ratatui = { workspace = true } serde = { workspace = true } -serde_with = { workspace = true } tokio = { workspace = true } [target.'cfg(target_os = "macos")'.dependencies] diff --git a/yazi-plugin/Cargo.toml b/yazi-plugin/Cargo.toml index 3af2bdf3..292feb25 100644 --- a/yazi-plugin/Cargo.toml +++ b/yazi-plugin/Cargo.toml @@ -26,7 +26,6 @@ yazi-dds = { path = "../yazi-dds", version = "26.2.2" } yazi-emulator = { path = "../yazi-emulator", version = "26.2.2" } yazi-fs = { path = "../yazi-fs", version = "26.2.2" } yazi-macro = { path = "../yazi-macro", version = "26.2.2" } -yazi-parser = { path = "../yazi-parser", version = "26.2.2" } yazi-proxy = { path = "../yazi-proxy", version = "26.2.2" } yazi-runner = { path = "../yazi-runner", version = "26.2.2" } yazi-scheduler = { path = "../yazi-scheduler", version = "26.2.2" } @@ -40,16 +39,12 @@ yazi-widgets = { path = "../yazi-widgets", version = "26.2.2" } ansi-to-tui = { workspace = true } anyhow = { workspace = true } futures = { workspace = true } -hashbrown = { workspace = true } mlua = { workspace = true } -parking_lot = { workspace = true } paste = { workspace = true } ratatui = { workspace = true } serde_json = { workspace = true } -syntect = { workspace = true } tokio = { workspace = true } tokio-stream = { workspace = true } -tokio-util = { workspace = true } tracing = { workspace = true } twox-hash = { workspace = true } unicode-width = { workspace = true } diff --git a/yazi-proxy/Cargo.toml b/yazi-proxy/Cargo.toml index 61b796a3..536e799a 100644 --- a/yazi-proxy/Cargo.toml +++ b/yazi-proxy/Cargo.toml @@ -13,7 +13,6 @@ rust-version.workspace = true workspace = true [dependencies] -yazi-binding = { path = "../yazi-binding", version = "26.2.2" } yazi-config = { path = "../yazi-config", version = "26.2.2" } yazi-core = { path = "../yazi-core", version = "26.2.2" } yazi-macro = { path = "../yazi-macro", version = "26.2.2" } @@ -23,5 +22,4 @@ yazi-shared = { path = "../yazi-shared", version = "26.2.2" } yazi-widgets = { path = "../yazi-widgets", version = "26.2.2" } # External dependencies -mlua = { workspace = true } tokio = { workspace = true } diff --git a/yazi-runner/README.md b/yazi-runner/README.md index bea35b9a..23292840 100644 --- a/yazi-runner/README.md +++ b/yazi-runner/README.md @@ -1,4 +1,4 @@ -# yazi-proxy +# yazi-runner This crate is part of [Yazi][source], and it is not supposed to be used outside, as there are no guarantees about the stability of its API. diff --git a/yazi-runner/src/previewer/previewer.rs b/yazi-runner/src/previewer/previewer.rs index 86901ee2..04f5a3e5 100644 --- a/yazi-runner/src/previewer/previewer.rs +++ b/yazi-runner/src/previewer/previewer.rs @@ -6,18 +6,11 @@ use crate::{Runner, loader::LOADER, previewer::{PeekError, PeekJob}}; impl Runner { pub async fn peek(&'static self, job: &PeekJob) -> mpsc::Receiver> { let (tx, rx) = mpsc::channel(1); - - select! { - _ = tx.closed() => {}, - r = LOADER.ensure(&job.action.name, |c| c.sync_peek) => { - match r { - Ok(true) => _ = tx.try_send(Err(PeekError::ShouldSync)), - Ok(false) => self.peek_do(job, tx), - Err(e) => _ = tx.try_send(Err(e.into())), - } - }, + match LOADER.ensure(&job.action.name, |c| c.sync_peek).await { + Ok(true) => _ = tx.try_send(Err(PeekError::ShouldSync)), + Ok(false) => self.peek_do(job, tx), + Err(e) => _ = tx.try_send(Err(e.into())), } - rx } diff --git a/yazi-scheduler/src/hook/in.rs b/yazi-scheduler/src/hook/in.rs index 117875f4..19209925 100644 --- a/yazi-scheduler/src/hook/in.rs +++ b/yazi-scheduler/src/hook/in.rs @@ -1,6 +1,6 @@ use yazi_shared::{Id, url::UrlBuf}; -use crate::{Task, TaskProg, file::FileInCopy}; +use crate::{Task, TaskProg}; #[derive(Debug)] pub(crate) enum HookIn { diff --git a/yazi-scheduler/src/scheduler.rs b/yazi-scheduler/src/scheduler.rs index 9b066fa5..a6106d78 100644 --- a/yazi-scheduler/src/scheduler.rs +++ b/yazi-scheduler/src/scheduler.rs @@ -154,7 +154,7 @@ impl Scheduler { } self.file.submit(FileInDownload { id, target, cha: None, retry: 0, done: done.clone() }, LOW); - done.clone() + done } pub fn file_upload(&self, target: UrlBuf) {