From 0b8aaba29bb7ceda912095746e1d64514a35b0a6 Mon Sep 17 00:00:00 2001 From: sxyazi Date: Sat, 29 Nov 2025 07:39:04 +0800 Subject: [PATCH] refactor: make Clippy happy --- Cargo.lock | 48 +++++++-------- Cargo.toml | 3 +- yazi-actor/Cargo.toml | 3 + yazi-actor/src/lib.rs | 2 - yazi-actor/src/lives/folder.rs | 2 +- yazi-actor/src/lives/preference.rs | 2 +- yazi-actor/src/lives/selected.rs | 2 +- yazi-actor/src/lives/yanked.rs | 2 +- yazi-actor/src/mgr/cd.rs | 4 +- yazi-actor/src/mgr/hover.rs | 2 +- yazi-actor/src/mgr/refresh.rs | 7 +-- yazi-adapter/Cargo.toml | 3 + yazi-adapter/src/brand.rs | 96 ++++++++++++++---------------- yazi-adapter/src/lib.rs | 2 - yazi-binding/src/url.rs | 4 +- yazi-boot/Cargo.toml | 3 + yazi-build/Cargo.toml | 3 + yazi-cli/Cargo.toml | 3 + yazi-codegen/Cargo.toml | 3 + yazi-core/src/lib.rs | 2 - yazi-dds/src/lib.rs | 2 - yazi-dds/src/sendable.rs | 4 +- yazi-fm/Cargo.toml | 2 +- yazi-fm/src/main.rs | 2 - yazi-fs/src/lib.rs | 2 - yazi-plugin/src/lib.rs | 2 - yazi-scheduler/src/lib.rs | 2 - yazi-sftp/src/lib.rs | 2 - yazi-shared/src/lib.rs | 2 - yazi-shared/src/path/buf.rs | 2 +- yazi-shared/src/url/cov.rs | 4 ++ yazi-vfs/src/lib.rs | 2 - yazi-widgets/src/lib.rs | 2 - 33 files changed, 108 insertions(+), 118 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6ce50e62..d3a753f9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -505,9 +505,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.47" +version = "1.2.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd405d82c84ff7f35739f175f67d8b9fb7687a0e84ccdc78bd3568839827cf07" +checksum = "c481bdbf0ed3b892f6f806287d72acd515b352a4ec27a208489b8c1bc839633a" dependencies = [ "find-msvc-tools", "jobserver", @@ -1856,9 +1856,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.82" +version = "0.3.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b011eec8cc36da2aab2d5cff675ec18454fad408585853910a202391cf9f8e65" +checksum = "464a3709c7f55f1f721e5389aa6ea4e3bc6aba669353300af094b29ffbdde1d8" dependencies = [ "once_cell", "wasm-bindgen", @@ -2173,9 +2173,9 @@ dependencies = [ [[package]] name = "moxcms" -version = "0.7.9" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fbdd3d7436f8b5e892b8b7ea114271ff0fa00bc5acae845d53b07d498616ef6" +checksum = "80986bbbcf925ebd3be54c26613d861255284584501595cf418320c078945608" dependencies = [ "num-traits", "pxfm", @@ -2798,9 +2798,9 @@ dependencies = [ [[package]] name = "pxfm" -version = "0.1.25" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3cbdf373972bf78df4d3b518d07003938e2c7d1fb5891e55f9cb6df57009d84" +checksum = "b3502d6155304a4173a5f2c34b52b7ed0dd085890326cb50fd625fdf39e86b3b" dependencies = [ "num-traits", ] @@ -3865,9 +3865,9 @@ checksum = "df8b2b54733674ad286d16267dcfc7a71ed5c776e4ac7aa3c3e2561f7c637bf2" [[package]] name = "tracing" -version = "0.1.41" +version = "0.1.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" +checksum = "2d15d90a0b5c19378952d479dc858407149d7bb45a14de0142f6c534b16fc647" dependencies = [ "pin-project-lite", "tracing-attributes", @@ -3920,9 +3920,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.20" +version = "0.3.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2054a14f5307d601f88daf0553e1cbf472acc4f2c51afab632431cdcd72124d5" +checksum = "2f30143827ddab0d256fd843b7a66d164e9f271cfa0dde49142c5ca0ca291f1e" dependencies = [ "matchers", "nu-ansi-term", @@ -4154,9 +4154,9 @@ dependencies = [ [[package]] name = "wasm-bindgen" -version = "0.2.105" +version = "0.2.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da95793dfc411fbbd93f5be7715b0578ec61fe87cb1a42b12eb625caa5c5ea60" +checksum = "0d759f433fa64a2d763d1340820e46e111a7a5ab75f993d1852d70b03dbb80fd" dependencies = [ "cfg-if", "once_cell", @@ -4167,9 +4167,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.55" +version = "0.4.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "551f88106c6d5e7ccc7cd9a16f312dd3b5d36ea8b4954304657d5dfba115d4a0" +checksum = "836d9622d604feee9e5de25ac10e3ea5f2d65b41eac0d9ce72eb5deae707ce7c" dependencies = [ "cfg-if", "js-sys", @@ -4180,9 +4180,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.105" +version = "0.2.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04264334509e04a7bf8690f2384ef5265f05143a4bff3889ab7a3269adab59c2" +checksum = "48cb0d2638f8baedbc542ed444afc0644a29166f1595371af4fecf8ce1e7eeb3" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -4190,9 +4190,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.105" +version = "0.2.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "420bc339d9f322e562942d52e115d57e950d12d88983a14c79b86859ee6c7ebc" +checksum = "cefb59d5cd5f92d9dcf80e4683949f15ca4b511f4ac0a6e14d4e1ac60c6ecd40" dependencies = [ "bumpalo", "proc-macro2", @@ -4203,18 +4203,18 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.105" +version = "0.2.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76f218a38c84bcb33c25ec7059b07847d465ce0e0a76b995e134a45adcb6af76" +checksum = "cbc538057e648b67f72a982e708d485b2efa771e1ac05fec311f9f63e5800db4" dependencies = [ "unicode-ident", ] [[package]] name = "web-sys" -version = "0.3.82" +version = "0.3.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a1f95c0d03a47f4ae1f7a64643a6bb97465d9b740f0fa8f90ea33915c99a9a1" +checksum = "9b32828d774c412041098d182a8b38b16ea816958e07cf40eec2bc080ae137ac" dependencies = [ "js-sys", "wasm-bindgen", diff --git a/Cargo.toml b/Cargo.toml index de637afa..5ab7628e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -54,7 +54,7 @@ tokio = { version = "1.48.0", features = [ "full" ] } tokio-stream = "0.1.17" tokio-util = "0.7.17" toml = { version = "0.9.8" } -tracing = { version = "0.1.41", features = [ "max_level_debug", "release_max_level_debug" ] } +tracing = { version = "0.1.43", features = [ "max_level_debug", "release_max_level_debug" ] } twox-hash = { version = "2.1.2", default-features = false, features = [ "std", "random", "xxhash3_128" ] } typed-path = "0.12.0" unicode-width = { version = "0.2.0", default-features = false } @@ -67,5 +67,6 @@ implicit_clone = "warn" len_without_is_empty = "allow" missing_safety_doc = "allow" module_inception = "allow" +option_map_unit_fn = "allow" unit_arg = "allow" use_self = "warn" diff --git a/yazi-actor/Cargo.toml b/yazi-actor/Cargo.toml index 6cad1e14..42af4c39 100644 --- a/yazi-actor/Cargo.toml +++ b/yazi-actor/Cargo.toml @@ -8,6 +8,9 @@ description = "Yazi actor model" homepage = "https://yazi-rs.github.io" repository = "https://github.com/sxyazi/yazi" +[lints] +workspace = true + [features] default = [ "vendored-lua" ] vendored-lua = [ "mlua/vendored" ] diff --git a/yazi-actor/src/lib.rs b/yazi-actor/src/lib.rs index def17563..95950dad 100644 --- a/yazi-actor/src/lib.rs +++ b/yazi-actor/src/lib.rs @@ -1,5 +1,3 @@ -#![allow(clippy::if_same_then_else, clippy::option_map_unit_fn)] - extern crate self as yazi_actor; yazi_macro::mod_pub!(cmp confirm core help input lives mgr pick spot tasks which); diff --git a/yazi-actor/src/lives/folder.rs b/yazi-actor/src/lives/folder.rs index 3ff86e7c..ab4ed872 100644 --- a/yazi-actor/src/lives/folder.rs +++ b/yazi-actor/src/lives/folder.rs @@ -54,7 +54,7 @@ impl Folder { impl UserData for Folder { fn add_fields>(fields: &mut F) { - cached_field!(fields, cwd, |_, me| Ok(Url::new(me.url.to_owned()))); + cached_field!(fields, cwd, |_, me| Ok(Url::new(&me.url))); cached_field!(fields, files, |_, me| Files::make(0..me.files.len(), me, &me.tab)); cached_field!(fields, stage, |_, me| Ok(FolderStage::new(me.stage.clone()))); cached_field!(fields, window, |_, me| Files::make(me.window.clone(), me, &me.tab)); diff --git a/yazi-actor/src/lives/preference.rs b/yazi-actor/src/lives/preference.rs index f77a30b5..a7236363 100644 --- a/yazi-actor/src/lives/preference.rs +++ b/yazi-actor/src/lives/preference.rs @@ -32,7 +32,7 @@ impl UserData for Preference { fields.add_field_method_get("sort_dir_first", |_, me| Ok(me.sort_dir_first)); fields.add_field_method_get("sort_translit", |_, me| Ok(me.sort_translit)); - cached_field!(fields, linemode, |_, me| Ok(me.linemode.to_string())); + cached_field!(fields, linemode, |lua, me| lua.create_string(&me.linemode)); fields.add_field_method_get("show_hidden", |_, me| Ok(me.show_hidden)); } } diff --git a/yazi-actor/src/lives/selected.rs b/yazi-actor/src/lives/selected.rs index b3569b96..2956dd37 100644 --- a/yazi-actor/src/lives/selected.rs +++ b/yazi-actor/src/lives/selected.rs @@ -11,7 +11,7 @@ impl Selected { let inner = PtrCell::from(inner); Lives::scoped_userdata(yazi_binding::Iter::new( - inner.as_static().values().cloned().map(yazi_binding::Url::new), + inner.as_static().values().map(yazi_binding::Url::new), Some(inner.len()), )) } diff --git a/yazi-actor/src/lives/yanked.rs b/yazi-actor/src/lives/yanked.rs index 8854936d..d5b9ee92 100644 --- a/yazi-actor/src/lives/yanked.rs +++ b/yazi-actor/src/lives/yanked.rs @@ -23,7 +23,7 @@ impl Yanked { Lives::scoped_userdata(Self { inner, iter: Lives::scoped_userdata(Iter::new( - inner.as_static().iter().cloned().map(yazi_binding::Url::new), + inner.as_static().iter().map(yazi_binding::Url::new), Some(inner.len()), ))?, }) diff --git a/yazi-actor/src/mgr/cd.rs b/yazi-actor/src/mgr/cd.rs index 244c8e22..5025bc70 100644 --- a/yazi-actor/src/mgr/cd.rs +++ b/yazi-actor/src/mgr/cd.rs @@ -34,13 +34,13 @@ impl Actor for Cd { // Take parent to history if let Some(t) = tab.parent.take() { - tab.history.insert(t.url.to_owned(), t); + tab.history.insert(t.url.clone(), t); } // Current let rep = tab.history.remove_or(&opt.target); let rep = mem::replace(&mut tab.current, rep); - tab.history.insert(rep.url.to_owned(), rep); + tab.history.insert(rep.url.clone(), rep); // Parent if let Some(parent) = opt.target.parent() { diff --git a/yazi-actor/src/mgr/hover.rs b/yazi-actor/src/mgr/hover.rs index 51c3b379..bb16eab4 100644 --- a/yazi-actor/src/mgr/hover.rs +++ b/yazi-actor/src/mgr/hover.rs @@ -30,7 +30,7 @@ impl Actor for Hover { { // `hover(Some)` occurs after user actions, such as create, rename, reveal, etc. // At this point, it's intuitive to track the location of the file regardless. - tab.current.trace = Some(u.to_owned()); + tab.current.trace = Some(u.clone()); } // Publish through DDS diff --git a/yazi-actor/src/mgr/refresh.rs b/yazi-actor/src/mgr/refresh.rs index b174d9a8..a81599ae 100644 --- a/yazi-actor/src/mgr/refresh.rs +++ b/yazi-actor/src/mgr/refresh.rs @@ -57,11 +57,8 @@ impl Refresh { } } - let futs: Vec<_> = folders - .iter() - .filter(|&f| f.url.is_internal()) - .map(|&f| go(f.url.to_owned(), f.cha)) - .collect(); + let futs: Vec<_> = + folders.iter().filter(|&f| f.url.is_internal()).map(|&f| go(f.url.clone(), f.cha)).collect(); if !futs.is_empty() { tokio::spawn(futures::future::join_all(futs)); diff --git a/yazi-adapter/Cargo.toml b/yazi-adapter/Cargo.toml index 9a7bd550..b05d654a 100644 --- a/yazi-adapter/Cargo.toml +++ b/yazi-adapter/Cargo.toml @@ -8,6 +8,9 @@ description = "Yazi image adapter" homepage = "https://yazi-rs.github.io" repository = "https://github.com/sxyazi/yazi" +[lints] +workspace = true + [dependencies] yazi-config = { path = "../yazi-config", version = "25.9.15" } yazi-fs = { path = "../yazi-fs", version = "25.9.15" } diff --git a/yazi-adapter/src/brand.rs b/yazi-adapter/src/brand.rs index 91c740f6..c180591c 100644 --- a/yazi-adapter/src/brand.rs +++ b/yazi-adapter/src/brand.rs @@ -44,42 +44,40 @@ impl Brand { } pub fn from_env() -> Option { - use Brand as B; - - let (term, program) = B::env(); + let (term, program) = Self::env(); let vars = [ - ("KITTY_WINDOW_ID", B::Kitty), - ("KONSOLE_VERSION", B::Konsole), - ("ITERM_SESSION_ID", B::Iterm2), - ("WEZTERM_EXECUTABLE", B::WezTerm), - ("GHOSTTY_RESOURCES_DIR", B::Ghostty), - ("WT_Session", B::Microsoft), - ("WARP_HONOR_PS1", B::Warp), - ("VSCODE_INJECTION", B::VSCode), - ("TABBY_CONFIG_DIRECTORY", B::Tabby), + ("KITTY_WINDOW_ID", Self::Kitty), + ("KONSOLE_VERSION", Self::Konsole), + ("ITERM_SESSION_ID", Self::Iterm2), + ("WEZTERM_EXECUTABLE", Self::WezTerm), + ("GHOSTTY_RESOURCES_DIR", Self::Ghostty), + ("WT_Session", Self::Microsoft), + ("WARP_HONOR_PS1", Self::Warp), + ("VSCODE_INJECTION", Self::VSCode), + ("TABBY_CONFIG_DIRECTORY", Self::Tabby), ]; match term.as_str() { - "xterm-kitty" => return Some(B::Kitty), - "foot" => return Some(B::Foot), - "foot-extra" => return Some(B::Foot), - "xterm-ghostty" => return Some(B::Ghostty), - "rio" => return Some(B::Rio), - "rxvt-unicode-256color" => return Some(B::Urxvt), + "xterm-kitty" => return Some(Self::Kitty), + "foot" => return Some(Self::Foot), + "foot-extra" => return Some(Self::Foot), + "xterm-ghostty" => return Some(Self::Ghostty), + "rio" => return Some(Self::Rio), + "rxvt-unicode-256color" => return Some(Self::Urxvt), _ => {} } match program.as_str() { - "iTerm.app" => return Some(B::Iterm2), - "WezTerm" => return Some(B::WezTerm), - "ghostty" => return Some(B::Ghostty), - "WarpTerminal" => return Some(B::Warp), - "rio" => return Some(B::Rio), - "BlackBox" => return Some(B::BlackBox), - "vscode" => return Some(B::VSCode), - "Tabby" => return Some(B::Tabby), - "Hyper" => return Some(B::Hyper), - "mintty" => return Some(B::Mintty), - "Apple_Terminal" => return Some(B::Apple), + "iTerm.app" => return Some(Self::Iterm2), + "WezTerm" => return Some(Self::WezTerm), + "ghostty" => return Some(Self::Ghostty), + "WarpTerminal" => return Some(Self::Warp), + "rio" => return Some(Self::Rio), + "BlackBox" => return Some(Self::BlackBox), + "vscode" => return Some(Self::VSCode), + "Tabby" => return Some(Self::Tabby), + "Hyper" => return Some(Self::Hyper), + "mintty" => return Some(Self::Mintty), + "Apple_Terminal" => return Some(Self::Apple), _ => {} } if let Some((var, brand)) = vars.into_iter().find(|&(s, _)| env_exists(s)) { @@ -91,30 +89,28 @@ impl Brand { } pub(super) fn adapters(self) -> &'static [crate::Adapter] { - use Brand as B; - use crate::Adapter as A; match self { - B::Kitty => &[A::Kgp], - B::Konsole => &[A::KgpOld], - B::Iterm2 => &[A::Iip, A::Sixel], - B::WezTerm => &[A::Iip, A::Sixel], - B::Foot => &[A::Sixel], - B::Ghostty => &[A::Kgp], - B::Microsoft => &[A::Sixel], - B::Warp => &[A::Iip, A::KgpOld], - B::Rio => &[A::Iip, A::Sixel], - B::BlackBox => &[A::Sixel], - B::VSCode => &[A::Iip, A::Sixel], - B::Tabby => &[A::Iip, A::Sixel], - B::Hyper => &[A::Iip, A::Sixel], - B::Mintty => &[A::Iip], - B::Tmux => &[], - B::VTerm => &[], - B::Apple => &[], - B::Urxvt => &[], - B::Bobcat => &[A::Iip, A::Sixel], + Self::Kitty => &[A::Kgp], + Self::Konsole => &[A::KgpOld], + Self::Iterm2 => &[A::Iip, A::Sixel], + Self::WezTerm => &[A::Iip, A::Sixel], + Self::Foot => &[A::Sixel], + Self::Ghostty => &[A::Kgp], + Self::Microsoft => &[A::Sixel], + Self::Warp => &[A::Iip, A::KgpOld], + Self::Rio => &[A::Iip, A::Sixel], + Self::BlackBox => &[A::Sixel], + Self::VSCode => &[A::Iip, A::Sixel], + Self::Tabby => &[A::Iip, A::Sixel], + Self::Hyper => &[A::Iip, A::Sixel], + Self::Mintty => &[A::Iip], + Self::Tmux => &[], + Self::VTerm => &[], + Self::Apple => &[], + Self::Urxvt => &[], + Self::Bobcat => &[A::Iip, A::Sixel], } } diff --git a/yazi-adapter/src/lib.rs b/yazi-adapter/src/lib.rs index cd0d3303..cf37ad5f 100644 --- a/yazi-adapter/src/lib.rs +++ b/yazi-adapter/src/lib.rs @@ -1,5 +1,3 @@ -#![allow(clippy::option_map_unit_fn)] - yazi_macro::mod_pub!(drivers); yazi_macro::mod_flat!(adapter brand dimension emulator image info mux unknown); diff --git a/yazi-binding/src/url.rs b/yazi-binding/src/url.rs index 06f3d7b5..c80ae7c7 100644 --- a/yazi-binding/src/url.rs +++ b/yazi-binding/src/url.rs @@ -56,9 +56,7 @@ impl From for yazi_shared::url::UrlCow<'_> { impl TryFrom<&[u8]> for Url { type Error = mlua::Error; - fn try_from(value: &[u8]) -> mlua::Result { - Ok(Self::new(UrlCow::try_from(value)?.into_owned())) - } + fn try_from(value: &[u8]) -> mlua::Result { Ok(Self::new(UrlCow::try_from(value)?)) } } impl Url { diff --git a/yazi-boot/Cargo.toml b/yazi-boot/Cargo.toml index 1130dcc7..a7aa5449 100644 --- a/yazi-boot/Cargo.toml +++ b/yazi-boot/Cargo.toml @@ -8,6 +8,9 @@ description = "Yazi bootstrapper" homepage = "https://yazi-rs.github.io" repository = "https://github.com/sxyazi/yazi" +[lints] +workspace = true + [dependencies] yazi-adapter = { path = "../yazi-adapter", version = "25.9.15" } yazi-config = { path = "../yazi-config", version = "25.9.15" } diff --git a/yazi-build/Cargo.toml b/yazi-build/Cargo.toml index d21e1cea..04bc8e69 100644 --- a/yazi-build/Cargo.toml +++ b/yazi-build/Cargo.toml @@ -8,6 +8,9 @@ description = "Yazi build system" homepage = "https://yazi-rs.github.io" repository = "https://github.com/sxyazi/yazi" +[lints] +workspace = true + [profile.release] codegen-units = 1 lto = true diff --git a/yazi-cli/Cargo.toml b/yazi-cli/Cargo.toml index 9ea61a80..8be1fcd0 100644 --- a/yazi-cli/Cargo.toml +++ b/yazi-cli/Cargo.toml @@ -8,6 +8,9 @@ description = "Yazi command-line interface" homepage = "https://yazi-rs.github.io" repository = "https://github.com/sxyazi/yazi" +[lints] +workspace = true + [profile.release] codegen-units = 1 lto = true diff --git a/yazi-codegen/Cargo.toml b/yazi-codegen/Cargo.toml index b22d5f82..08af4e41 100644 --- a/yazi-codegen/Cargo.toml +++ b/yazi-codegen/Cargo.toml @@ -8,6 +8,9 @@ description = "Yazi code generator" homepage = "https://yazi-rs.github.io" repository = "https://github.com/sxyazi/yazi" +[lints] +workspace = true + [lib] proc-macro = true diff --git a/yazi-core/src/lib.rs b/yazi-core/src/lib.rs index 4f94bf8b..b95d01c7 100644 --- a/yazi-core/src/lib.rs +++ b/yazi-core/src/lib.rs @@ -1,5 +1,3 @@ -#![allow(clippy::if_same_then_else, clippy::len_without_is_empty, clippy::option_map_unit_fn)] - yazi_macro::mod_pub!(cmp confirm help input mgr notify pick spot tab tasks which); yazi_macro::mod_flat!(core); diff --git a/yazi-dds/src/lib.rs b/yazi-dds/src/lib.rs index 095e15bb..652bf3c9 100644 --- a/yazi-dds/src/lib.rs +++ b/yazi-dds/src/lib.rs @@ -1,5 +1,3 @@ -#![allow(clippy::option_map_unit_fn)] - mod macros; yazi_macro::mod_pub!(ember spark); diff --git a/yazi-dds/src/sendable.rs b/yazi-dds/src/sendable.rs index 3b8953ed..0fa95ff3 100644 --- a/yazi-dds/src/sendable.rs +++ b/yazi-dds/src/sendable.rs @@ -120,7 +120,7 @@ impl Sendable { Value::Table(tbl) } Data::Id(i) => yazi_binding::Id(*i).into_lua(lua)?, - Data::Url(u) => yazi_binding::Url::new(u.clone()).into_lua(lua)?, + Data::Url(u) => yazi_binding::Url::new(u).into_lua(lua)?, Data::Path(u) => yazi_binding::Path::new(u).into_lua(lua)?, Data::Bytes(b) => Value::String(lua.create_string(b)?), Data::Any(a) => { @@ -243,7 +243,7 @@ impl Sendable { DataKey::Number(n) => Value::Number(n.0), DataKey::String(s) => Value::String(lua.create_string(&**s)?), DataKey::Id(i) => yazi_binding::Id(*i).into_lua(lua)?, - DataKey::Url(u) => yazi_binding::Url::new(u.clone()).into_lua(lua)?, + DataKey::Url(u) => yazi_binding::Url::new(u).into_lua(lua)?, DataKey::Path(u) => yazi_binding::Path::new(u).into_lua(lua)?, DataKey::Bytes(b) => Value::String(lua.create_string(b)?), }) diff --git a/yazi-fm/Cargo.toml b/yazi-fm/Cargo.toml index d5a7cb36..3968ab5a 100644 --- a/yazi-fm/Cargo.toml +++ b/yazi-fm/Cargo.toml @@ -60,7 +60,7 @@ tokio-stream = { workspace = true } # Logging tracing = { workspace = true } tracing-appender = "0.2.4" -tracing-subscriber = { version = "0.3.20", features = [ "env-filter" ] } +tracing-subscriber = { version = "0.3.22", features = [ "env-filter" ] } [target."cfg(unix)".dependencies] libc = { workspace = true } diff --git a/yazi-fm/src/main.rs b/yazi-fm/src/main.rs index bd0032bb..9033317f 100644 --- a/yazi-fm/src/main.rs +++ b/yazi-fm/src/main.rs @@ -1,5 +1,3 @@ -#![allow(clippy::if_same_then_else)] - #[cfg(all(not(target_os = "macos"), not(target_os = "windows")))] #[global_allocator] static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc; diff --git a/yazi-fs/src/lib.rs b/yazi-fs/src/lib.rs index 52fd93ce..36d5962a 100644 --- a/yazi-fs/src/lib.rs +++ b/yazi-fs/src/lib.rs @@ -1,5 +1,3 @@ -#![allow(clippy::if_same_then_else, clippy::option_map_unit_fn)] - yazi_macro::mod_pub!(cha error mounts path provider); yazi_macro::mod_flat!(cwd file files filter fns hash op scheme sorter sorting splatter stage url xdg); diff --git a/yazi-plugin/src/lib.rs b/yazi-plugin/src/lib.rs index 9b767077..a07afcc1 100644 --- a/yazi-plugin/src/lib.rs +++ b/yazi-plugin/src/lib.rs @@ -1,5 +1,3 @@ -#![allow(clippy::if_same_then_else)] - yazi_macro::mod_pub!(bindings elements external fs isolate loader process pubsub runtime theme utils); yazi_macro::mod_flat!(lua); diff --git a/yazi-scheduler/src/lib.rs b/yazi-scheduler/src/lib.rs index 6a288622..4120f1a8 100644 --- a/yazi-scheduler/src/lib.rs +++ b/yazi-scheduler/src/lib.rs @@ -1,5 +1,3 @@ -#![allow(clippy::option_map_unit_fn)] - mod macros; yazi_macro::mod_pub!(file plugin prework process); diff --git a/yazi-sftp/src/lib.rs b/yazi-sftp/src/lib.rs index 9a0e87cc..2b6d05c0 100644 --- a/yazi-sftp/src/lib.rs +++ b/yazi-sftp/src/lib.rs @@ -1,5 +1,3 @@ -#![allow(clippy::len_without_is_empty)] - pub mod fs; pub mod requests; pub mod responses; diff --git a/yazi-shared/src/lib.rs b/yazi-shared/src/lib.rs index 6c3406f6..6471e522 100644 --- a/yazi-shared/src/lib.rs +++ b/yazi-shared/src/lib.rs @@ -1,5 +1,3 @@ -#![allow(clippy::option_map_unit_fn)] - yazi_macro::mod_pub!(data errors event loc path pool scheme shell strand translit url wtf8); yazi_macro::mod_flat!(alias bytes chars condition debounce either env id layer natsort os predictor ro_cell source sync_cell terminal tests throttle time utf8); diff --git a/yazi-shared/src/path/buf.rs b/yazi-shared/src/path/buf.rs index 807c65a9..1699e061 100644 --- a/yazi-shared/src/path/buf.rs +++ b/yazi-shared/src/path/buf.rs @@ -42,7 +42,7 @@ impl Hash for PathBufDyn { // --- PartialEq impl PartialEq for PathBufDyn { - fn eq(&self, other: &PathBufDyn) -> bool { self.as_path() == other.as_path() } + fn eq(&self, other: &Self) -> bool { self.as_path() == other.as_path() } } impl PartialEq> for PathBufDyn { diff --git a/yazi-shared/src/url/cov.rs b/yazi-shared/src/url/cov.rs index f9439f85..42520ae9 100644 --- a/yazi-shared/src/url/cov.rs +++ b/yazi-shared/src/url/cov.rs @@ -54,6 +54,10 @@ impl From for UrlBuf { fn from(value: UrlBufCov) -> Self { value.0 } } +impl From<&UrlBufCov> for UrlBuf { + fn from(value: &UrlBufCov) -> Self { value.0.clone() } +} + impl From for UrlBufCov { fn from(value: UrlBuf) -> Self { Self(value) } } diff --git a/yazi-vfs/src/lib.rs b/yazi-vfs/src/lib.rs index 1b3ab656..8abc3e7d 100644 --- a/yazi-vfs/src/lib.rs +++ b/yazi-vfs/src/lib.rs @@ -1,5 +1,3 @@ -#![allow(clippy::if_same_then_else)] - yazi_macro::mod_pub!(provider); yazi_macro::mod_flat!(cha file files fns op); diff --git a/yazi-widgets/src/lib.rs b/yazi-widgets/src/lib.rs index 2b44b317..aab44f98 100644 --- a/yazi-widgets/src/lib.rs +++ b/yazi-widgets/src/lib.rs @@ -1,5 +1,3 @@ -#![allow(clippy::if_same_then_else)] - yazi_macro::mod_pub!(input); yazi_macro::mod_flat!(clipboard scrollable);