From 631afd09ee22ec7cfb1453e13c546adfdeace487 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=92=B2=E9=9B=85=20=C2=B7=20Misaki=20Masa?= Date: Sat, 21 Sep 2024 19:54:01 +0800 Subject: [PATCH] fix: warnings should be output to `stderr` instead of `stdout` (#1669) --- Cargo.lock | 114 ++++++++---------- Cargo.toml | 6 +- rustfmt.toml | 6 +- yazi-adapter/src/adapter.rs | 2 +- yazi-adapter/src/chafa.rs | 2 +- yazi-adapter/src/emulator.rs | 6 +- yazi-adapter/src/iip.rs | 6 +- yazi-adapter/src/image.rs | 2 +- yazi-adapter/src/kitty.rs | 4 +- yazi-adapter/src/kitty_old.rs | 6 +- yazi-adapter/src/lib.rs | 2 +- yazi-adapter/src/sixel.rs | 4 +- yazi-adapter/src/ueberzug.rs | 4 +- yazi-boot/Cargo.toml | 4 +- yazi-boot/build.rs | 2 +- yazi-boot/src/args.rs | 2 +- yazi-boot/src/boot.rs | 2 +- yazi-cli/Cargo.toml | 6 +- yazi-cli/build.rs | 2 +- yazi-cli/src/args.rs | 4 +- yazi-cli/src/package/deploy.rs | 4 +- yazi-cli/src/package/git.rs | 2 +- yazi-cli/src/package/parser.rs | 2 +- yazi-config/preset/keymap.toml | 8 +- yazi-config/src/keymap/deserializers.rs | 2 +- yazi-config/src/lib.rs | 2 +- yazi-config/src/manager/mouse.rs | 2 +- yazi-config/src/open/open.rs | 2 +- yazi-config/src/open/rule.rs | 2 +- yazi-config/src/plugin/fetcher.rs | 2 +- yazi-config/src/plugin/plugin.rs | 2 +- yazi-config/src/plugin/preloader.rs | 2 +- yazi-config/src/plugin/previewer.rs | 2 +- yazi-config/src/preset.rs | 2 +- yazi-config/src/theme/icons.rs | 2 +- yazi-config/src/theme/theme.rs | 2 +- yazi-core/src/completion/commands/trigger.rs | 2 +- yazi-core/src/help/help.rs | 4 +- yazi-core/src/input/commands/backward.rs | 2 +- yazi-core/src/input/commands/close.rs | 2 +- yazi-core/src/input/commands/delete.rs | 2 +- yazi-core/src/input/commands/escape.rs | 2 +- yazi-core/src/input/commands/forward.rs | 4 +- yazi-core/src/input/commands/insert.rs | 2 +- yazi-core/src/input/commands/kill.rs | 2 +- yazi-core/src/input/commands/move_.rs | 2 +- yazi-core/src/input/commands/paste.rs | 2 +- yazi-core/src/input/commands/show.rs | 2 +- yazi-core/src/input/commands/visual.rs | 2 +- yazi-core/src/input/commands/yank.rs | 2 +- yazi-core/src/input/input.rs | 6 +- yazi-core/src/manager/commands/bulk_rename.rs | 10 +- yazi-core/src/manager/commands/create.rs | 2 +- yazi-core/src/manager/commands/open.rs | 6 +- yazi-core/src/manager/commands/rename.rs | 2 +- yazi-core/src/manager/commands/seek.rs | 2 +- .../src/manager/commands/update_files.rs | 2 +- .../src/manager/commands/update_mimetype.rs | 2 +- yazi-core/src/manager/watcher.rs | 4 +- yazi-core/src/notify/commands/push.rs | 2 +- yazi-core/src/notify/commands/tick.rs | 2 +- yazi-core/src/select/select.rs | 2 +- yazi-core/src/tab/commands/cd.rs | 4 +- yazi-core/src/tab/commands/filter.rs | 4 +- yazi-core/src/tab/commands/find.rs | 4 +- yazi-core/src/tab/commands/reveal.rs | 2 +- yazi-core/src/tab/commands/search.rs | 4 +- yazi-core/src/tab/config.rs | 2 +- yazi-core/src/tab/preview.rs | 4 +- yazi-core/src/tab/tab.rs | 2 +- yazi-core/src/tasks/commands/inspect.rs | 4 +- yazi-core/src/tasks/preload.rs | 4 +- yazi-core/src/tasks/process.rs | 2 +- yazi-core/src/tasks/tasks.rs | 4 +- yazi-core/src/which/commands/show.rs | 4 +- yazi-core/src/which/sorter.rs | 4 +- yazi-core/src/which/which.rs | 2 +- yazi-dds/Cargo.toml | 2 +- yazi-dds/src/body/body.rs | 2 +- yazi-dds/src/body/bulk.rs | 2 +- yazi-dds/src/client.rs | 4 +- yazi-dds/src/payload.rs | 6 +- yazi-dds/src/pubsub.rs | 4 +- yazi-dds/src/pump.rs | 6 +- yazi-dds/src/sendable.rs | 2 +- yazi-dds/src/server.rs | 2 +- yazi-dds/src/state.rs | 2 +- yazi-fm/src/app/app.rs | 4 +- yazi-fm/src/app/commands/accept_payload.rs | 2 +- yazi-fm/src/app/commands/mouse.rs | 2 +- yazi-fm/src/app/commands/plugin.rs | 4 +- yazi-fm/src/app/commands/quit.rs | 2 +- yazi-fm/src/app/commands/render.rs | 4 +- yazi-fm/src/app/commands/resume.rs | 2 +- yazi-fm/src/completion/completion.rs | 2 +- yazi-fm/src/components/progress.rs | 2 +- yazi-fm/src/executor.rs | 2 +- yazi-fm/src/input/input.rs | 2 +- yazi-fm/src/lives/selected.rs | 2 +- yazi-fm/src/lives/tab.rs | 2 +- yazi-fm/src/lives/tabs.rs | 2 +- yazi-fm/src/logs.rs | 2 +- yazi-fm/src/root.rs | 4 +- yazi-fm/src/router.rs | 4 +- yazi-fm/src/term.rs | 8 +- yazi-fm/src/which/cand.rs | 2 +- yazi-fs/src/files.rs | 4 +- yazi-fs/src/sorter.rs | 2 +- yazi-plugin/src/bindings/input.rs | 2 +- yazi-plugin/src/bindings/permit.rs | 2 +- yazi-plugin/src/clipboard.rs | 4 +- yazi-plugin/src/external/highlighter.rs | 6 +- yazi-plugin/src/isolate/peek.rs | 4 +- yazi-plugin/src/isolate/seek.rs | 4 +- yazi-plugin/src/process/command.rs | 2 +- yazi-plugin/src/utils/call.rs | 2 +- yazi-plugin/src/utils/image.rs | 2 +- yazi-plugin/src/utils/layer.rs | 2 +- yazi-plugin/src/utils/preview.rs | 4 +- yazi-plugin/src/utils/sync.rs | 4 +- yazi-plugin/src/utils/user.rs | 2 +- yazi-proxy/src/app.rs | 2 +- yazi-proxy/src/completion.rs | 2 +- yazi-proxy/src/confirm.rs | 2 +- yazi-proxy/src/input.rs | 2 +- yazi-proxy/src/manager.rs | 2 +- yazi-proxy/src/select.rs | 2 +- yazi-proxy/src/tab.rs | 2 +- yazi-proxy/src/tasks.rs | 2 +- yazi-scheduler/src/file/file.rs | 8 +- yazi-scheduler/src/plugin/plugin.rs | 4 +- yazi-scheduler/src/prework/op.rs | 2 +- yazi-scheduler/src/prework/prework.rs | 6 +- yazi-scheduler/src/scheduler.rs | 8 +- yazi-shared/src/condition.rs | 2 +- yazi-shared/src/debounce.rs | 2 +- yazi-shared/src/event/cmd.rs | 2 +- yazi-shared/src/event/data.rs | 2 +- yazi-shared/src/fs/fns.rs | 4 +- yazi-shared/src/fs/op.rs | 2 +- yazi-shared/src/fs/url.rs | 2 +- yazi-shared/src/theme/color.rs | 2 +- yazi-shared/src/theme/style.rs | 2 +- 143 files changed, 266 insertions(+), 280 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0ce0eac5..a2125464 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "addr2line" -version = "0.22.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" +checksum = "f5fb1d8e4442bd405fdfd1dacb42792696b0cf9cb15882e5d097b742a676d375" dependencies = [ "gimli", ] @@ -135,9 +135,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.88" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e1496f8fb1fbf272686b8d37f523dab3e4a7443300055e74cdaa449f3114356" +checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" [[package]] name = "arbitrary" @@ -208,17 +208,17 @@ dependencies = [ [[package]] name = "backtrace" -version = "0.3.73" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ "addr2line", - "cc", "cfg-if", "libc", - "miniz_oxide 0.7.4", + "miniz_oxide 0.8.0", "object", "rustc-demangle", + "windows-targets 0.52.6", ] [[package]] @@ -330,9 +330,9 @@ checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" [[package]] name = "bytes" -version = "1.7.1" +version = "1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" +checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" [[package]] name = "cassowary" @@ -351,9 +351,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.17" +version = "1.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a93fe60e2fc87b6ba2c117f67ae14f66e3fc7d6a1e612a25adb238cc980eadb3" +checksum = "07b1695e2c7e8fc85310cde85aeaab7e3097f593c91d209d3f9df76c928100f0" dependencies = [ "jobserver", "libc", @@ -390,9 +390,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.17" +version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e5a21b8495e732f1b3c364c9949b201ca7bae518c502c80256c96ad79eaf6ac" +checksum = "b0956a43b323ac1afaffc053ed5c4b7c1f1800bacd1683c353aabbb752515dd3" dependencies = [ "clap_builder", "clap_derive", @@ -400,9 +400,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.17" +version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cf2dd12af7a047ad9d6da2b6b249759a22a7abc0f474c1dae1777afa4b21a73" +checksum = "4d72166dd41634086d5803a47eb71ae740e61d84709c36f3c34110173db3961b" dependencies = [ "anstream", "anstyle", @@ -412,9 +412,9 @@ dependencies = [ [[package]] name = "clap_complete" -version = "4.5.26" +version = "4.5.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "205d5ef6d485fa47606b98b0ddc4ead26eb850aaa86abfb562a94fb3280ecba0" +checksum = "8937760c3f4c60871870b8c3ee5f9b30771f792a7045c48bcbba999d7d6b3b8e" dependencies = [ "clap", ] @@ -441,9 +441,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.13" +version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "501d359d5f3dcaf6ecdeee48833ae73ec6e42723a1e52419c79abf9507eec0a0" +checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" dependencies = [ "heck", "proc-macro2", @@ -752,9 +752,9 @@ dependencies = [ [[package]] name = "error-code" -version = "3.2.0" +version = "3.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0474425d51df81997e2f90a21591180b38eccf27292d755f3e30750225c175b" +checksum = "a5d9305ccc6942a704f4335694ecd3de2ea531b114ac2d51f5f843750787a92f" [[package]] name = "event-listener" @@ -978,18 +978,6 @@ dependencies = [ "wasi", ] -[[package]] -name = "getset" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e45727250e75cc04ff2846a66397da8ef2b3db8e40e0cef4df67950a07621eb9" -dependencies = [ - "proc-macro-error", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "gif" version = "0.13.1" @@ -1002,9 +990,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.29.0" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" +checksum = "32085ea23f3234fc7846555e85283ba4de91e21016dc0455a16286d87a292d64" [[package]] name = "globset" @@ -1062,9 +1050,9 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.60" +version = "0.1.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -1482,9 +1470,9 @@ dependencies = [ [[package]] name = "mlua-sys" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ab7a5b4756b8177a2dfa8e0bbcde63bd4000afbc4ab20cbb68d114a25470f29" +checksum = "ebe026d6bd1583a9cf9080e189030ddaea7e6f5f0deb366a8e26f8a26c4135b8" dependencies = [ "cc", "cfg-if", @@ -1733,9 +1721,9 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "parking" -version = "2.2.0" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" +checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" [[package]] name = "parking_lot" @@ -2038,9 +2026,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" +checksum = "0884ad60e090bf1345b93da0a5de8923c93884cd03f40dfcfddd3b4bee661853" dependencies = [ "bitflags 2.6.0", ] @@ -2108,9 +2096,9 @@ checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustix" -version = "0.38.36" +version = "0.38.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f55e80d50763938498dd5ebb18647174e0c76dc38c5505294bb224624f30f36" +checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" dependencies = [ "bitflags 2.6.0", "errno", @@ -2356,7 +2344,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2", - "quote", "unicode-ident", ] @@ -2597,9 +2584,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.20" +version = "0.22.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" +checksum = "3b072cee73c449a636ffd6f32bd8de3a9f7119139aff882f44943ce2986dc5cf" dependencies = [ "indexmap", "serde", @@ -2714,24 +2701,24 @@ checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" [[package]] name = "unicode-normalization" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" +checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" dependencies = [ "tinyvec", ] [[package]] name = "unicode-segmentation" -version = "1.11.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" +checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" [[package]] name = "unicode-truncate" @@ -2746,9 +2733,9 @@ dependencies = [ [[package]] name = "unicode-width" -version = "0.1.13" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" +checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" [[package]] name = "url" @@ -2832,9 +2819,9 @@ checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" [[package]] name = "vergen" -version = "9.0.0" +version = "9.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c32e7318e93a9ac53693b6caccfb05ff22e04a44c7cf8a279051f24c09da286f" +checksum = "349ed9e45296a581f455bc18039878f409992999bc1d5da12a6800eb18c8752f" dependencies = [ "anyhow", "derive_builder", @@ -2845,9 +2832,9 @@ dependencies = [ [[package]] name = "vergen-gitcl" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bbdc9746577cb4767f218d320ee0b623d415e8130332f8f562b910b61cc2c4e" +checksum = "2a3a7f91caabecefc3c249fd864b11d4abe315c166fbdb568964421bccfd2b7a" dependencies = [ "anyhow", "derive_builder", @@ -2859,13 +2846,12 @@ dependencies = [ [[package]] name = "vergen-lib" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e06bee42361e43b60f363bad49d63798d0f42fb1768091812270eca00c784720" +checksum = "229eaddb0050920816cf051e619affaf18caa3dd512de8de5839ccbc8e53abb0" dependencies = [ "anyhow", "derive_builder", - "getset", "rustversion", ] diff --git a/Cargo.toml b/Cargo.toml index 3c9322de..64668a31 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,11 +11,11 @@ strip = true [workspace.dependencies] ansi-to-tui = "6.0.0" -anyhow = "1.0.88" +anyhow = "1.0.89" arc-swap = "1.7.1" base64 = "0.22.1" bitflags = "2.6.0" -clap = { version = "4.5.17", features = [ "derive" ] } +clap = { version = "4.5.18", features = [ "derive" ] } crossterm = { version = "0.28.1", features = [ "event-stream" ] } dirs = "5.0.1" futures = "0.3.30" @@ -34,5 +34,5 @@ tokio = { version = "1.40.0", features = [ "full" ] } tokio-stream = "0.1.16" tokio-util = "0.7.12" tracing = { version = "0.1.40", features = [ "max_level_debug", "release_max_level_warn" ] } -unicode-width = "0.1.13" +unicode-width = "0.1.14" uzers = "0.12.1" diff --git a/rustfmt.toml b/rustfmt.toml index 69622ca3..4f435576 100644 --- a/rustfmt.toml +++ b/rustfmt.toml @@ -1,6 +1,6 @@ color = "Never" condense_wildcard_suffixes = true -edition = "2021" +edition = "2024" enum_discrim_align_threshold = 99 fn_single_line = true format_code_in_doc_comments = false @@ -10,7 +10,7 @@ format_macro_bodies = true format_strings = false hard_tabs = true hex_literal_case = "Lower" -hide_parse_errors = true +show_parse_errors = false imports_indent = "Visual" imports_layout = "Horizontal" imports_granularity = "Crate" @@ -27,5 +27,5 @@ unstable_features = true use_field_init_shorthand = true use_small_heuristics = "Max" use_try_shorthand = true -version = "Two" +style_edition = "2024" wrap_comments = true diff --git a/yazi-adapter/src/adapter.rs b/yazi-adapter/src/adapter.rs index 9199462e..9ddd6860 100644 --- a/yazi-adapter/src/adapter.rs +++ b/yazi-adapter/src/adapter.rs @@ -6,7 +6,7 @@ use tracing::warn; use yazi_shared::env_exists; use super::{Iip, Kitty, KittyOld}; -use crate::{Chafa, Emulator, Sixel, Ueberzug, SHOWN, TMUX, WSL}; +use crate::{Chafa, Emulator, SHOWN, Sixel, TMUX, Ueberzug, WSL}; #[derive(Clone, Copy, PartialEq, Eq, Debug)] pub enum Adapter { diff --git a/yazi-adapter/src/chafa.rs b/yazi-adapter/src/chafa.rs index 948855c5..5fe5570f 100644 --- a/yazi-adapter/src/chafa.rs +++ b/yazi-adapter/src/chafa.rs @@ -1,7 +1,7 @@ use std::{io::Write, path::Path, process::Stdio}; use ansi_to_tui::IntoText; -use anyhow::{bail, Result}; +use anyhow::{Result, bail}; use crossterm::{cursor::MoveTo, queue}; use ratatui::layout::Rect; use tokio::process::Command; diff --git a/yazi-adapter/src/emulator.rs b/yazi-adapter/src/emulator.rs index c9634103..ac105e70 100644 --- a/yazi-adapter/src/emulator.rs +++ b/yazi-adapter/src/emulator.rs @@ -1,13 +1,13 @@ -use std::{env, io::{stderr, LineWriter}, time::Duration}; +use std::{env, io::{LineWriter, stderr}, time::Duration}; -use anyhow::{anyhow, bail, Result}; +use anyhow::{Result, anyhow, bail}; use crossterm::{cursor::{RestorePosition, SavePosition}, execute, style::Print, terminal::{disable_raw_mode, enable_raw_mode}}; use scopeguard::defer; use tokio::{io::{AsyncReadExt, BufReader}, time::timeout}; use tracing::{error, warn}; use yazi_shared::env_exists; -use crate::{tcsi, Adapter, TMUX}; +use crate::{Adapter, TMUX, tcsi}; #[derive(Clone, Debug)] pub enum Emulator { diff --git a/yazi-adapter/src/iip.rs b/yazi-adapter/src/iip.rs index 3d2db5bb..fe039d90 100644 --- a/yazi-adapter/src/iip.rs +++ b/yazi-adapter/src/iip.rs @@ -1,14 +1,14 @@ use std::{fmt::Write, io::Write as ioWrite, path::Path}; use anyhow::Result; -use base64::{engine::{general_purpose::STANDARD, Config}, Engine}; +use base64::{Engine, engine::{Config, general_purpose::STANDARD}}; use crossterm::{cursor::MoveTo, queue}; -use image::{codecs::{jpeg::JpegEncoder, png::PngEncoder}, DynamicImage, ExtendedColorType, ImageEncoder}; +use image::{DynamicImage, ExtendedColorType, ImageEncoder, codecs::{jpeg::JpegEncoder, png::PngEncoder}}; use ratatui::layout::Rect; use yazi_config::PREVIEW; use super::image::Image; -use crate::{adapter::Adapter, Emulator, CLOSE, START}; +use crate::{CLOSE, Emulator, START, adapter::Adapter}; pub(super) struct Iip; diff --git a/yazi-adapter/src/image.rs b/yazi-adapter/src/image.rs index 45ff5370..a858ac82 100644 --- a/yazi-adapter/src/image.rs +++ b/yazi-adapter/src/image.rs @@ -2,7 +2,7 @@ use std::{fs::File, io::BufReader, path::{Path, PathBuf}}; use anyhow::Result; use exif::{In, Tag}; -use image::{codecs::{jpeg::JpegEncoder, png::PngEncoder}, imageops::{self, FilterType}, DynamicImage, ExtendedColorType, ImageEncoder, ImageError, Limits}; +use image::{DynamicImage, ExtendedColorType, ImageEncoder, ImageError, Limits, codecs::{jpeg::JpegEncoder, png::PngEncoder}, imageops::{self, FilterType}}; use ratatui::layout::Rect; use yazi_config::{PREVIEW, TASKS}; diff --git a/yazi-adapter/src/kitty.rs b/yazi-adapter/src/kitty.rs index 2c90ede4..3e3ce8fd 100644 --- a/yazi-adapter/src/kitty.rs +++ b/yazi-adapter/src/kitty.rs @@ -2,13 +2,13 @@ use core::str; use std::{io::Write, path::Path}; use anyhow::Result; -use base64::{engine::general_purpose, Engine}; +use base64::{Engine, engine::general_purpose}; use crossterm::{cursor::MoveTo, queue}; use image::DynamicImage; use ratatui::layout::Rect; use super::image::Image; -use crate::{adapter::Adapter, Emulator, CLOSE, ESCAPE, START}; +use crate::{CLOSE, ESCAPE, Emulator, START, adapter::Adapter}; static DIACRITICS: [char; 297] = [ '\u{0305}', diff --git a/yazi-adapter/src/kitty_old.rs b/yazi-adapter/src/kitty_old.rs index 1054707f..1b82698a 100644 --- a/yazi-adapter/src/kitty_old.rs +++ b/yazi-adapter/src/kitty_old.rs @@ -1,13 +1,13 @@ use core::str; -use std::{io::{stderr, LineWriter, Write}, path::Path}; +use std::{io::{LineWriter, Write, stderr}, path::Path}; use anyhow::Result; -use base64::{engine::general_purpose, Engine}; +use base64::{Engine, engine::general_purpose}; use image::DynamicImage; use ratatui::layout::Rect; use super::image::Image; -use crate::{adapter::Adapter, Emulator, CLOSE, ESCAPE, START}; +use crate::{CLOSE, ESCAPE, Emulator, START, adapter::Adapter}; pub(super) struct KittyOld; diff --git a/yazi-adapter/src/lib.rs b/yazi-adapter/src/lib.rs index 5987a839..0698d13c 100644 --- a/yazi-adapter/src/lib.rs +++ b/yazi-adapter/src/lib.rs @@ -20,7 +20,7 @@ use kitty::*; use kitty_old::*; use sixel::*; use ueberzug::*; -use yazi_shared::{env_exists, in_wsl, RoCell}; +use yazi_shared::{RoCell, env_exists, in_wsl}; pub use crate::image::*; diff --git a/yazi-adapter/src/sixel.rs b/yazi-adapter/src/sixel.rs index b8e48fce..06a551c2 100644 --- a/yazi-adapter/src/sixel.rs +++ b/yazi-adapter/src/sixel.rs @@ -1,13 +1,13 @@ use std::{io::Write, path::Path}; -use anyhow::{bail, Result}; +use anyhow::{Result, bail}; use color_quant::NeuQuant; use crossterm::{cursor::MoveTo, queue}; use image::DynamicImage; use ratatui::layout::Rect; use yazi_config::PREVIEW; -use crate::{adapter::Adapter, Emulator, Image, CLOSE, ESCAPE, START}; +use crate::{CLOSE, ESCAPE, Emulator, Image, START, adapter::Adapter}; pub(super) struct Sixel; diff --git a/yazi-adapter/src/ueberzug.rs b/yazi-adapter/src/ueberzug.rs index f235bd43..d7a07cbb 100644 --- a/yazi-adapter/src/ueberzug.rs +++ b/yazi-adapter/src/ueberzug.rs @@ -1,12 +1,12 @@ use std::{path::{Path, PathBuf}, process::Stdio}; -use anyhow::{bail, Result}; +use anyhow::{Result, bail}; use imagesize::ImageSize; use ratatui::layout::Rect; use tokio::{io::AsyncWriteExt, process::{Child, Command}, sync::mpsc::{self, UnboundedSender}}; use tracing::{debug, warn}; use yazi_config::PREVIEW; -use yazi_shared::{env_exists, RoCell}; +use yazi_shared::{RoCell, env_exists}; use crate::{Adapter, Dimension}; diff --git a/yazi-boot/Cargo.toml b/yazi-boot/Cargo.toml index efe70fa9..e9f9eade 100644 --- a/yazi-boot/Cargo.toml +++ b/yazi-boot/Cargo.toml @@ -20,7 +20,7 @@ serde = { workspace = true } [build-dependencies] clap = { workspace = true } -clap_complete = "4.5.26" +clap_complete = "4.5.29" clap_complete_fig = "4.5.2" clap_complete_nushell = "4.5.3" -vergen-gitcl = { version = "1.0.0", features = [ "build" ] } +vergen-gitcl = { version = "1.0.1", features = [ "build" ] } diff --git a/yazi-boot/build.rs b/yazi-boot/build.rs index 754b1e8f..a4ab04fd 100644 --- a/yazi-boot/build.rs +++ b/yazi-boot/build.rs @@ -4,7 +4,7 @@ mod args; use std::{env, error::Error}; use clap::CommandFactory; -use clap_complete::{generate_to, Shell}; +use clap_complete::{Shell, generate_to}; use vergen_gitcl::{BuildBuilder, Emitter, GitclBuilder}; fn main() -> Result<(), Box> { diff --git a/yazi-boot/src/args.rs b/yazi-boot/src/args.rs index f2b4105a..1327c9ca 100644 --- a/yazi-boot/src/args.rs +++ b/yazi-boot/src/args.rs @@ -1,6 +1,6 @@ use std::path::PathBuf; -use clap::{command, Parser}; +use clap::{Parser, command}; #[derive(Debug, Default, Parser)] #[command(name = "yazi")] diff --git a/yazi-boot/src/boot.rs b/yazi-boot/src/boot.rs index 9bbb142c..c066ced1 100644 --- a/yazi-boot/src/boot.rs +++ b/yazi-boot/src/boot.rs @@ -1,7 +1,7 @@ use std::{collections::HashSet, ffi::OsString, path::PathBuf}; use serde::Serialize; -use yazi_shared::{fs::{current_cwd, expand_path}, Xdg}; +use yazi_shared::{Xdg, fs::{current_cwd, expand_path}}; #[derive(Debug, Default, Serialize)] pub struct Boot { diff --git a/yazi-cli/Cargo.toml b/yazi-cli/Cargo.toml index cc85fc63..dbc39872 100644 --- a/yazi-cli/Cargo.toml +++ b/yazi-cli/Cargo.toml @@ -20,7 +20,7 @@ crossterm = { workspace = true } md-5 = { workspace = true } serde_json = { workspace = true } tokio = { workspace = true } -toml_edit = "0.22.20" +toml_edit = "0.22.21" [build-dependencies] yazi-shared = { path = "../yazi-shared", version = "0.3.3" } @@ -28,11 +28,11 @@ yazi-shared = { path = "../yazi-shared", version = "0.3.3" } # External build dependencies anyhow = { workspace = true } clap = { workspace = true } -clap_complete = "4.5.26" +clap_complete = "4.5.29" clap_complete_fig = "4.5.2" clap_complete_nushell = "4.5.3" serde_json = { workspace = true } -vergen-gitcl = { version = "1.0.0", features = [ "build" ] } +vergen-gitcl = { version = "1.0.1", features = [ "build" ] } [target.'cfg(target_os = "macos")'.dependencies] crossterm = { workspace = true, features = [ "use-dev-tty", "libc" ] } diff --git a/yazi-cli/build.rs b/yazi-cli/build.rs index 878d3671..f9f33a67 100644 --- a/yazi-cli/build.rs +++ b/yazi-cli/build.rs @@ -4,7 +4,7 @@ mod args; use std::{env, error::Error}; use clap::CommandFactory; -use clap_complete::{generate_to, Shell}; +use clap_complete::{Shell, generate_to}; use vergen_gitcl::{BuildBuilder, Emitter, GitclBuilder}; fn main() -> Result<(), Box> { diff --git a/yazi-cli/src/args.rs b/yazi-cli/src/args.rs index 2fd287ad..11a3697c 100644 --- a/yazi-cli/src/args.rs +++ b/yazi-cli/src/args.rs @@ -1,7 +1,7 @@ use std::borrow::Cow; -use anyhow::{bail, Result}; -use clap::{command, Parser, Subcommand}; +use anyhow::{Result, bail}; +use clap::{Parser, Subcommand, command}; #[derive(Parser)] #[command(name = "Ya", about, long_about = None)] diff --git a/yazi-cli/src/package/deploy.rs b/yazi-cli/src/package/deploy.rs index a67ff117..bb845f08 100644 --- a/yazi-cli/src/package/deploy.rs +++ b/yazi-cli/src/package/deploy.rs @@ -1,6 +1,6 @@ -use anyhow::{bail, Context, Result}; +use anyhow::{Context, Result, bail}; use tokio::fs; -use yazi_shared::{fs::{maybe_exists, must_exists}, Xdg}; +use yazi_shared::{Xdg, fs::{maybe_exists, must_exists}}; use super::Package; diff --git a/yazi-cli/src/package/git.rs b/yazi-cli/src/package/git.rs index 6d2cf20e..6be4a4f3 100644 --- a/yazi-cli/src/package/git.rs +++ b/yazi-cli/src/package/git.rs @@ -1,6 +1,6 @@ use std::path::Path; -use anyhow::{bail, Context, Result}; +use anyhow::{Context, Result, bail}; use tokio::process::Command; use yazi_shared::strip_trailing_newline; diff --git a/yazi-cli/src/package/parser.rs b/yazi-cli/src/package/parser.rs index 88699738..c58020e8 100644 --- a/yazi-cli/src/package/parser.rs +++ b/yazi-cli/src/package/parser.rs @@ -1,4 +1,4 @@ -use anyhow::{bail, Context, Result}; +use anyhow::{Context, Result, bail}; use tokio::fs; use toml_edit::{Array, DocumentMut, InlineTable, Item, Value}; use yazi_shared::Xdg; diff --git a/yazi-config/preset/keymap.toml b/yazi-config/preset/keymap.toml index 354a938a..b420a970 100644 --- a/yazi-config/preset/keymap.toml +++ b/yazi-config/preset/keymap.toml @@ -100,8 +100,8 @@ keymap = [ # Find { on = "/", run = "find --smart", desc = "Find next file" }, { on = "?", run = "find --previous --smart", desc = "Find previous file" }, - { on = "n", run = "find_arrow", desc = "Go to the next found" }, - { on = "N", run = "find_arrow --previous", desc = "Go to the previous found" }, + { on = "n", run = "find_arrow", desc = "Goto the next found" }, + { on = "N", run = "find_arrow --previous", desc = "Goto the previous found" }, # Sorting { on = [ ",", "m" ], run = [ "sort modified --reverse=no", "linemode mtime" ], desc = "Sort by modified time" }, @@ -120,8 +120,8 @@ keymap = [ # Goto { on = [ "g", "h" ], run = "cd ~", desc = "Go home" }, - { on = [ "g", "c" ], run = "cd ~/.config", desc = "Go to ~/.config" }, - { on = [ "g", "d" ], run = "cd ~/Downloads", desc = "Go to ~/Downloads" }, + { on = [ "g", "c" ], run = "cd ~/.config", desc = "Goto ~/.config" }, + { on = [ "g", "d" ], run = "cd ~/Downloads", desc = "Goto ~/Downloads" }, { on = [ "g", "" ], run = "cd --interactive", desc = "Jump interactively" }, # Tabs diff --git a/yazi-config/src/keymap/deserializers.rs b/yazi-config/src/keymap/deserializers.rs index dea0a226..66287891 100644 --- a/yazi-config/src/keymap/deserializers.rs +++ b/yazi-config/src/keymap/deserializers.rs @@ -1,7 +1,7 @@ use std::{fmt, str::FromStr}; use anyhow::Result; -use serde::{de::{self, Visitor}, Deserializer}; +use serde::{Deserializer, de::{self, Visitor}}; use yazi_shared::event::Cmd; use crate::keymap::Key; diff --git a/yazi-config/src/lib.rs b/yazi-config/src/lib.rs index 061b869f..910f9eed 100644 --- a/yazi-config/src/lib.rs +++ b/yazi-config/src/lib.rs @@ -85,7 +85,7 @@ Please replace e.g. `shell` with `shell --interactive`, `shell "my-template"` wi // TODO: Remove in v0.3.6 if matches!(INPUT.create_title, popup::InputCreateTitle::One(_)) { - println!( + eprintln!( r#"WARNING: The `create_title` under `[input]` now accepts an array instead of a string to support different titles for `create` and `create --dir` command. Please change `create_title = "Create:"` to `create_title = ["Create:", "Create (dir):"]` in your yazi.toml. diff --git a/yazi-config/src/manager/mouse.rs b/yazi-config/src/manager/mouse.rs index 6507db33..b4b82c5b 100644 --- a/yazi-config/src/manager/mouse.rs +++ b/yazi-config/src/manager/mouse.rs @@ -1,4 +1,4 @@ -use anyhow::{bail, Result}; +use anyhow::{Result, bail}; use bitflags::bitflags; use crossterm::event::MouseEventKind; use serde::{Deserialize, Serialize}; diff --git a/yazi-config/src/open/open.rs b/yazi-config/src/open/open.rs index ec44330e..60361818 100644 --- a/yazi-config/src/open/open.rs +++ b/yazi-config/src/open/open.rs @@ -5,7 +5,7 @@ use serde::{Deserialize, Deserializer}; use yazi_shared::MIME_DIR; use super::Opener; -use crate::{open::OpenRule, Preset}; +use crate::{Preset, open::OpenRule}; #[derive(Debug)] pub struct Open { diff --git a/yazi-config/src/open/rule.rs b/yazi-config/src/open/rule.rs index d69371d2..3c01c82f 100644 --- a/yazi-config/src/open/rule.rs +++ b/yazi-config/src/open/rule.rs @@ -1,6 +1,6 @@ use std::fmt; -use serde::{de::{self, Visitor}, Deserialize, Deserializer}; +use serde::{Deserialize, Deserializer, de::{self, Visitor}}; use crate::pattern::Pattern; diff --git a/yazi-config/src/plugin/fetcher.rs b/yazi-config/src/plugin/fetcher.rs index 57bf3bc9..73ce60ec 100644 --- a/yazi-config/src/plugin/fetcher.rs +++ b/yazi-config/src/plugin/fetcher.rs @@ -1,7 +1,7 @@ use std::path::Path; use serde::Deserialize; -use yazi_shared::{event::Cmd, Condition, MIME_DIR}; +use yazi_shared::{Condition, MIME_DIR, event::Cmd}; use crate::{Pattern, Priority}; diff --git a/yazi-config/src/plugin/plugin.rs b/yazi-config/src/plugin/plugin.rs index 1129ddbe..ba274011 100644 --- a/yazi-config/src/plugin/plugin.rs +++ b/yazi-config/src/plugin/plugin.rs @@ -3,7 +3,7 @@ use std::{collections::HashSet, path::Path, str::FromStr}; use serde::Deserialize; use super::{Fetcher, Preloader, Previewer}; -use crate::{plugin::MAX_PREWORKERS, Preset}; +use crate::{Preset, plugin::MAX_PREWORKERS}; #[derive(Deserialize)] pub struct Plugin { diff --git a/yazi-config/src/plugin/preloader.rs b/yazi-config/src/plugin/preloader.rs index 8453cdc4..577f1eee 100644 --- a/yazi-config/src/plugin/preloader.rs +++ b/yazi-config/src/plugin/preloader.rs @@ -1,7 +1,7 @@ use std::path::Path; use serde::Deserialize; -use yazi_shared::{event::Cmd, MIME_DIR}; +use yazi_shared::{MIME_DIR, event::Cmd}; use crate::{Pattern, Priority}; diff --git a/yazi-config/src/plugin/previewer.rs b/yazi-config/src/plugin/previewer.rs index 40ace446..0e4d573e 100644 --- a/yazi-config/src/plugin/previewer.rs +++ b/yazi-config/src/plugin/previewer.rs @@ -1,7 +1,7 @@ use std::path::Path; use serde::Deserialize; -use yazi_shared::{event::Cmd, MIME_DIR}; +use yazi_shared::{MIME_DIR, event::Cmd}; use crate::Pattern; diff --git a/yazi-config/src/preset.rs b/yazi-config/src/preset.rs index 6587712b..848c2960 100644 --- a/yazi-config/src/preset.rs +++ b/yazi-config/src/preset.rs @@ -1,6 +1,6 @@ use std::{borrow::Cow, path::{Path, PathBuf}}; -use anyhow::{anyhow, Context, Result}; +use anyhow::{Context, Result, anyhow}; use toml::{Table, Value}; use crate::{preset, theme::Flavor}; diff --git a/yazi-config/src/theme/icons.rs b/yazi-config/src/theme/icons.rs index 7df1b4cd..35662da6 100644 --- a/yazi-config/src/theme/icons.rs +++ b/yazi-config/src/theme/icons.rs @@ -2,7 +2,7 @@ use std::collections::HashMap; use anyhow::Result; use serde::{Deserialize, Deserializer}; -use yazi_shared::{fs::File, theme::{Color, Icon, Style}, Condition}; +use yazi_shared::{Condition, fs::File, theme::{Color, Icon, Style}}; use crate::{Pattern, Preset}; diff --git a/yazi-config/src/theme/theme.rs b/yazi-config/src/theme/theme.rs index da757143..a8d6e417 100644 --- a/yazi-config/src/theme/theme.rs +++ b/yazi-config/src/theme/theme.rs @@ -2,7 +2,7 @@ use std::{path::PathBuf, str::FromStr}; use serde::{Deserialize, Serialize}; use validator::Validate; -use yazi_shared::{fs::expand_path, theme::Style, Xdg}; +use yazi_shared::{Xdg, fs::expand_path, theme::Style}; use super::{Filetype, Flavor, Icons}; diff --git a/yazi-core/src/completion/commands/trigger.rs b/yazi-core/src/completion/commands/trigger.rs index 788d5555..d4976f57 100644 --- a/yazi-core/src/completion/commands/trigger.rs +++ b/yazi-core/src/completion/commands/trigger.rs @@ -1,7 +1,7 @@ use std::{borrow::Cow, mem, path::{MAIN_SEPARATOR, MAIN_SEPARATOR_STR}}; use tokio::fs; -use yazi_shared::{emit, event::{Cmd, Data}, render, Layer}; +use yazi_shared::{Layer, emit, event::{Cmd, Data}, render}; use crate::completion::Completion; diff --git a/yazi-core/src/help/help.rs b/yazi-core/src/help/help.rs index b722bb41..aa6ed403 100644 --- a/yazi-core/src/help/help.rs +++ b/yazi-core/src/help/help.rs @@ -1,8 +1,8 @@ use crossterm::event::KeyCode; use unicode_width::UnicodeWidthStr; use yazi_adapter::Dimension; -use yazi_config::{keymap::{Chord, Key}, KEYMAP}; -use yazi_shared::{render, render_and, Layer}; +use yazi_config::{KEYMAP, keymap::{Chord, Key}}; +use yazi_shared::{Layer, render, render_and}; use super::HELP_MARGIN; use crate::input::Input; diff --git a/yazi-core/src/input/commands/backward.rs b/yazi-core/src/input/commands/backward.rs index d25f23d6..a4fb9219 100644 --- a/yazi-core/src/input/commands/backward.rs +++ b/yazi-core/src/input/commands/backward.rs @@ -1,4 +1,4 @@ -use yazi_shared::{event::Cmd, CharKind}; +use yazi_shared::{CharKind, event::Cmd}; use crate::input::Input; diff --git a/yazi-core/src/input/commands/close.rs b/yazi-core/src/input/commands/close.rs index 42ecfdaa..52096f97 100644 --- a/yazi-core/src/input/commands/close.rs +++ b/yazi-core/src/input/commands/close.rs @@ -1,5 +1,5 @@ use yazi_proxy::CompletionProxy; -use yazi_shared::{event::Cmd, render, InputError}; +use yazi_shared::{InputError, event::Cmd, render}; use crate::input::Input; diff --git a/yazi-core/src/input/commands/delete.rs b/yazi-core/src/input/commands/delete.rs index 115d6fac..a9cae2b2 100644 --- a/yazi-core/src/input/commands/delete.rs +++ b/yazi-core/src/input/commands/delete.rs @@ -1,6 +1,6 @@ use yazi_shared::{event::Cmd, render}; -use crate::input::{op::InputOp, Input}; +use crate::input::{Input, op::InputOp}; pub struct Opt { cut: bool, diff --git a/yazi-core/src/input/commands/escape.rs b/yazi-core/src/input/commands/escape.rs index cd0ab484..cfd6e91e 100644 --- a/yazi-core/src/input/commands/escape.rs +++ b/yazi-core/src/input/commands/escape.rs @@ -1,7 +1,7 @@ use yazi_proxy::CompletionProxy; use yazi_shared::{event::Cmd, render}; -use crate::input::{op::InputOp, Input, InputMode}; +use crate::input::{Input, InputMode, op::InputOp}; pub struct Opt; diff --git a/yazi-core/src/input/commands/forward.rs b/yazi-core/src/input/commands/forward.rs index afcbee50..290b456e 100644 --- a/yazi-core/src/input/commands/forward.rs +++ b/yazi-core/src/input/commands/forward.rs @@ -1,6 +1,6 @@ -use yazi_shared::{event::Cmd, CharKind}; +use yazi_shared::{CharKind, event::Cmd}; -use crate::input::{op::InputOp, Input}; +use crate::input::{Input, op::InputOp}; pub struct Opt { end_of_word: bool, diff --git a/yazi-core/src/input/commands/insert.rs b/yazi-core/src/input/commands/insert.rs index d27ec367..14dd5373 100644 --- a/yazi-core/src/input/commands/insert.rs +++ b/yazi-core/src/input/commands/insert.rs @@ -1,6 +1,6 @@ use yazi_shared::{event::Cmd, render}; -use crate::input::{op::InputOp, Input, InputMode}; +use crate::input::{Input, InputMode, op::InputOp}; pub struct Opt { append: bool, diff --git a/yazi-core/src/input/commands/kill.rs b/yazi-core/src/input/commands/kill.rs index d1cbeb07..97ac4455 100644 --- a/yazi-core/src/input/commands/kill.rs +++ b/yazi-core/src/input/commands/kill.rs @@ -1,6 +1,6 @@ use std::ops::RangeBounds; -use yazi_shared::{event::Cmd, render, CharKind}; +use yazi_shared::{CharKind, event::Cmd, render}; use crate::input::Input; diff --git a/yazi-core/src/input/commands/move_.rs b/yazi-core/src/input/commands/move_.rs index aac48b7e..092f47c5 100644 --- a/yazi-core/src/input/commands/move_.rs +++ b/yazi-core/src/input/commands/move_.rs @@ -1,7 +1,7 @@ use unicode_width::UnicodeWidthStr; use yazi_shared::{event::{Cmd, Data}, render}; -use crate::input::{op::InputOp, snap::InputSnap, Input}; +use crate::input::{Input, op::InputOp, snap::InputSnap}; pub struct Opt { step: isize, diff --git a/yazi-core/src/input/commands/paste.rs b/yazi-core/src/input/commands/paste.rs index 2c313ea4..b339b2b2 100644 --- a/yazi-core/src/input/commands/paste.rs +++ b/yazi-core/src/input/commands/paste.rs @@ -1,7 +1,7 @@ use yazi_plugin::CLIPBOARD; use yazi_shared::{event::Cmd, render}; -use crate::input::{op::InputOp, Input}; +use crate::input::{Input, op::InputOp}; pub struct Opt { before: bool, diff --git a/yazi-core/src/input/commands/show.rs b/yazi-core/src/input/commands/show.rs index 1601ca19..0442d29d 100644 --- a/yazi-core/src/input/commands/show.rs +++ b/yazi-core/src/input/commands/show.rs @@ -1,6 +1,6 @@ use tokio::sync::mpsc; use yazi_config::popup::InputCfg; -use yazi_shared::{event::Cmd, render, InputError}; +use yazi_shared::{InputError, event::Cmd, render}; use crate::input::Input; diff --git a/yazi-core/src/input/commands/visual.rs b/yazi-core/src/input/commands/visual.rs index b53d3374..58e65676 100644 --- a/yazi-core/src/input/commands/visual.rs +++ b/yazi-core/src/input/commands/visual.rs @@ -1,6 +1,6 @@ use yazi_shared::{event::Cmd, render}; -use crate::input::{op::InputOp, Input, InputMode}; +use crate::input::{Input, InputMode, op::InputOp}; impl Input { #[inline] diff --git a/yazi-core/src/input/commands/yank.rs b/yazi-core/src/input/commands/yank.rs index 2babc8f3..8485d524 100644 --- a/yazi-core/src/input/commands/yank.rs +++ b/yazi-core/src/input/commands/yank.rs @@ -1,6 +1,6 @@ use yazi_shared::{event::Cmd, render}; -use crate::input::{op::InputOp, Input}; +use crate::input::{Input, op::InputOp}; impl Input { pub fn yank(&mut self, _: Cmd) { diff --git a/yazi-core/src/input/input.rs b/yazi-core/src/input/input.rs index 3fea5764..21bb5c07 100644 --- a/yazi-core/src/input/input.rs +++ b/yazi-core/src/input/input.rs @@ -2,11 +2,11 @@ use std::ops::Range; use tokio::sync::mpsc::UnboundedSender; use unicode_width::UnicodeWidthStr; -use yazi_config::{popup::Position, INPUT}; +use yazi_config::{INPUT, popup::Position}; use yazi_plugin::CLIPBOARD; -use yazi_shared::{render, InputError}; +use yazi_shared::{InputError, render}; -use super::{mode::InputMode, op::InputOp, InputSnap, InputSnaps}; +use super::{InputSnap, InputSnaps, mode::InputMode, op::InputOp}; #[derive(Default)] pub struct Input { diff --git a/yazi-core/src/manager/commands/bulk_rename.rs b/yazi-core/src/manager/commands/bulk_rename.rs index ab32d7f5..0f4d7d1d 100644 --- a/yazi-core/src/manager/commands/bulk_rename.rs +++ b/yazi-core/src/manager/commands/bulk_rename.rs @@ -1,12 +1,12 @@ -use std::{borrow::Cow, collections::HashMap, ffi::{OsStr, OsString}, io::{stderr, BufWriter, Write}, path::PathBuf}; +use std::{borrow::Cow, collections::HashMap, ffi::{OsStr, OsString}, io::{BufWriter, Write, stderr}, path::PathBuf}; -use anyhow::{anyhow, Result}; +use anyhow::{Result, anyhow}; use scopeguard::defer; -use tokio::{fs::{self, OpenOptions}, io::{stdin, AsyncReadExt, AsyncWriteExt}}; +use tokio::{fs::{self, OpenOptions}, io::{AsyncReadExt, AsyncWriteExt, stdin}}; use yazi_config::{OPEN, PREVIEW}; use yazi_dds::Pubsub; -use yazi_proxy::{AppProxy, TasksProxy, HIDER, WATCHER}; -use yazi_shared::{fs::{max_common_root, maybe_exists, paths_to_same_file, File, Url}, terminal_clear}; +use yazi_proxy::{AppProxy, HIDER, TasksProxy, WATCHER}; +use yazi_shared::{fs::{File, Url, max_common_root, maybe_exists, paths_to_same_file}, terminal_clear}; use crate::manager::Manager; diff --git a/yazi-core/src/manager/commands/create.rs b/yazi-core/src/manager/commands/create.rs index 586a7e70..1ea36b0e 100644 --- a/yazi-core/src/manager/commands/create.rs +++ b/yazi-core/src/manager/commands/create.rs @@ -4,7 +4,7 @@ use anyhow::Result; use tokio::fs; use yazi_config::popup::{ConfirmCfg, InputCfg}; use yazi_proxy::{ConfirmProxy, InputProxy, TabProxy, WATCHER}; -use yazi_shared::{event::Cmd, fs::{maybe_exists, ok_or_not_found, realname, File, FilesOp, Url, UrnBuf}}; +use yazi_shared::{event::Cmd, fs::{File, FilesOp, Url, UrnBuf, maybe_exists, ok_or_not_found, realname}}; use crate::manager::Manager; diff --git a/yazi-core/src/manager/commands/open.rs b/yazi-core/src/manager/commands/open.rs index 8f4ad853..2d4f7830 100644 --- a/yazi-core/src/manager/commands/open.rs +++ b/yazi-core/src/manager/commands/open.rs @@ -2,11 +2,11 @@ use std::{borrow::Cow, ffi::OsString}; use tracing::error; use yazi_boot::ARGS; -use yazi_config::{popup::SelectCfg, OPEN}; +use yazi_config::{OPEN, popup::SelectCfg}; use yazi_fs::Folder; use yazi_plugin::isolate; -use yazi_proxy::{options::OpenDoOpt, ManagerProxy, TasksProxy}; -use yazi_shared::{emit, event::{Cmd, EventQuit}, fs::{File, Url}, MIME_DIR}; +use yazi_proxy::{ManagerProxy, TasksProxy, options::OpenDoOpt}; +use yazi_shared::{MIME_DIR, emit, event::{Cmd, EventQuit}, fs::{File, Url}}; use crate::{manager::Manager, tasks::Tasks}; diff --git a/yazi-core/src/manager/commands/rename.rs b/yazi-core/src/manager/commands/rename.rs index bb49be34..feaa06ac 100644 --- a/yazi-core/src/manager/commands/rename.rs +++ b/yazi-core/src/manager/commands/rename.rs @@ -5,7 +5,7 @@ use tokio::fs; use yazi_config::popup::{ConfirmCfg, InputCfg}; use yazi_dds::Pubsub; use yazi_proxy::{ConfirmProxy, InputProxy, TabProxy, WATCHER}; -use yazi_shared::{event::Cmd, fs::{maybe_exists, ok_or_not_found, paths_to_same_file, realname, File, FilesOp, Url, UrnBuf}}; +use yazi_shared::{event::Cmd, fs::{File, FilesOp, Url, UrnBuf, maybe_exists, ok_or_not_found, paths_to_same_file, realname}}; use crate::manager::Manager; diff --git a/yazi-core/src/manager/commands/seek.rs b/yazi-core/src/manager/commands/seek.rs index 5beb7a17..ba52aa64 100644 --- a/yazi-core/src/manager/commands/seek.rs +++ b/yazi-core/src/manager/commands/seek.rs @@ -1,6 +1,6 @@ use yazi_config::PLUGIN; use yazi_plugin::isolate; -use yazi_shared::{event::{Cmd, Data}, render, MIME_DIR}; +use yazi_shared::{MIME_DIR, event::{Cmd, Data}, render}; use crate::manager::Manager; diff --git a/yazi-core/src/manager/commands/update_files.rs b/yazi-core/src/manager/commands/update_files.rs index 7eb54b4a..909b803e 100644 --- a/yazi-core/src/manager/commands/update_files.rs +++ b/yazi-core/src/manager/commands/update_files.rs @@ -4,7 +4,7 @@ use yazi_fs::Folder; use yazi_proxy::ManagerProxy; use yazi_shared::{event::Cmd, fs::FilesOp, render}; -use crate::{manager::{Manager, LINKED}, tab::Tab, tasks::Tasks}; +use crate::{manager::{LINKED, Manager}, tab::Tab, tasks::Tasks}; pub struct Opt { op: FilesOp, diff --git a/yazi-core/src/manager/commands/update_mimetype.rs b/yazi-core/src/manager/commands/update_mimetype.rs index 2953e3f3..d7d1c937 100644 --- a/yazi-core/src/manager/commands/update_mimetype.rs +++ b/yazi-core/src/manager/commands/update_mimetype.rs @@ -3,7 +3,7 @@ use std::collections::HashMap; use tracing::error; use yazi_shared::{event::Cmd, fs::Url, render}; -use crate::{manager::{Manager, LINKED}, tasks::Tasks}; +use crate::{manager::{LINKED, Manager}, tasks::Tasks}; pub struct Opt { updates: HashMap, diff --git a/yazi-core/src/manager/watcher.rs b/yazi-core/src/manager/watcher.rs index df183758..88d06924 100644 --- a/yazi-core/src/manager/watcher.rs +++ b/yazi-core/src/manager/watcher.rs @@ -4,12 +4,12 @@ use anyhow::Result; use notify::{PollWatcher, RecommendedWatcher, RecursiveMode, Watcher as _Watcher}; use parking_lot::RwLock; use tokio::{fs, pin, sync::{mpsc::{self, UnboundedReceiver}, watch}}; -use tokio_stream::{wrappers::UnboundedReceiverStream, StreamExt}; +use tokio_stream::{StreamExt, wrappers::UnboundedReceiverStream}; use tracing::error; use yazi_fs::{Files, Folder}; use yazi_plugin::isolate; use yazi_proxy::WATCHER; -use yazi_shared::{fs::{realname_unchecked, Cha, File, FilesOp, Url}, RoCell}; +use yazi_shared::{RoCell, fs::{Cha, File, FilesOp, Url, realname_unchecked}}; use super::Linked; diff --git a/yazi-core/src/notify/commands/push.rs b/yazi-core/src/notify/commands/push.rs index facc5888..b9ebf25d 100644 --- a/yazi-core/src/notify/commands/push.rs +++ b/yazi-core/src/notify/commands/push.rs @@ -1,6 +1,6 @@ use std::time::Instant; -use yazi_shared::{emit, event::Cmd, Layer}; +use yazi_shared::{Layer, emit, event::Cmd}; use crate::notify::{Message, Notify}; diff --git a/yazi-core/src/notify/commands/tick.rs b/yazi-core/src/notify/commands/tick.rs index 8e3f1bef..29eb7fdd 100644 --- a/yazi-core/src/notify/commands/tick.rs +++ b/yazi-core/src/notify/commands/tick.rs @@ -1,7 +1,7 @@ use std::time::Duration; use ratatui::layout::Rect; -use yazi_shared::{emit, event::{Cmd, Data}, Layer}; +use yazi_shared::{Layer, emit, event::{Cmd, Data}}; use crate::notify::Notify; diff --git a/yazi-core/src/select/select.rs b/yazi-core/src/select/select.rs index 26e4f4fa..c86f27a4 100644 --- a/yazi-core/src/select/select.rs +++ b/yazi-core/src/select/select.rs @@ -1,6 +1,6 @@ use anyhow::Result; use tokio::sync::oneshot::Sender; -use yazi_config::{popup::Position, SELECT}; +use yazi_config::{SELECT, popup::Position}; #[derive(Default)] pub struct Select { diff --git a/yazi-core/src/tab/commands/cd.rs b/yazi-core/src/tab/commands/cd.rs index c9446fe8..bbf8a1a9 100644 --- a/yazi-core/src/tab/commands/cd.rs +++ b/yazi-core/src/tab/commands/cd.rs @@ -1,11 +1,11 @@ use std::{mem, time::Duration}; use tokio::{fs, pin}; -use tokio_stream::{wrappers::UnboundedReceiverStream, StreamExt}; +use tokio_stream::{StreamExt, wrappers::UnboundedReceiverStream}; use yazi_config::popup::InputCfg; use yazi_dds::Pubsub; use yazi_proxy::{CompletionProxy, InputProxy, ManagerProxy, TabProxy}; -use yazi_shared::{event::{Cmd, Data}, fs::{expand_path, Url}, render, Debounce, InputError}; +use yazi_shared::{Debounce, InputError, event::{Cmd, Data}, fs::{Url, expand_path}, render}; use crate::tab::Tab; diff --git a/yazi-core/src/tab/commands/filter.rs b/yazi-core/src/tab/commands/filter.rs index ed8a112f..0302c864 100644 --- a/yazi-core/src/tab/commands/filter.rs +++ b/yazi-core/src/tab/commands/filter.rs @@ -1,11 +1,11 @@ use std::time::Duration; use tokio::pin; -use tokio_stream::{wrappers::UnboundedReceiverStream, StreamExt}; +use tokio_stream::{StreamExt, wrappers::UnboundedReceiverStream}; use yazi_config::popup::InputCfg; use yazi_fs::{Filter, FilterCase}; use yazi_proxy::{InputProxy, ManagerProxy}; -use yazi_shared::{emit, event::Cmd, render, Debounce, InputError, Layer}; +use yazi_shared::{Debounce, InputError, Layer, emit, event::Cmd, render}; use crate::tab::Tab; diff --git a/yazi-core/src/tab/commands/find.rs b/yazi-core/src/tab/commands/find.rs index 90f04943..eab50738 100644 --- a/yazi-core/src/tab/commands/find.rs +++ b/yazi-core/src/tab/commands/find.rs @@ -1,11 +1,11 @@ use std::time::Duration; use tokio::pin; -use tokio_stream::{wrappers::UnboundedReceiverStream, StreamExt}; +use tokio_stream::{StreamExt, wrappers::UnboundedReceiverStream}; use yazi_config::popup::InputCfg; use yazi_fs::FilterCase; use yazi_proxy::InputProxy; -use yazi_shared::{emit, event::Cmd, render, Debounce, InputError, Layer}; +use yazi_shared::{Debounce, InputError, Layer, emit, event::Cmd, render}; use crate::tab::{Finder, Tab}; diff --git a/yazi-core/src/tab/commands/reveal.rs b/yazi-core/src/tab/commands/reveal.rs index 50410d95..06850927 100644 --- a/yazi-core/src/tab/commands/reveal.rs +++ b/yazi-core/src/tab/commands/reveal.rs @@ -1,5 +1,5 @@ use yazi_proxy::ManagerProxy; -use yazi_shared::{event::{Cmd, Data}, fs::{expand_path, File, FilesOp, Url}}; +use yazi_shared::{event::{Cmd, Data}, fs::{File, FilesOp, Url, expand_path}}; use crate::tab::Tab; diff --git a/yazi-core/src/tab/commands/search.rs b/yazi-core/src/tab/commands/search.rs index b7a73c1f..d3550db2 100644 --- a/yazi-core/src/tab/commands/search.rs +++ b/yazi-core/src/tab/commands/search.rs @@ -1,11 +1,11 @@ use std::{mem, time::Duration}; use tokio::pin; -use tokio_stream::{wrappers::UnboundedReceiverStream, StreamExt}; +use tokio_stream::{StreamExt, wrappers::UnboundedReceiverStream}; use tracing::error; use yazi_config::popup::InputCfg; use yazi_plugin::external; -use yazi_proxy::{options::{SearchOpt, SearchOptVia}, AppProxy, InputProxy, ManagerProxy, TabProxy}; +use yazi_proxy::{AppProxy, InputProxy, ManagerProxy, TabProxy, options::{SearchOpt, SearchOptVia}}; use yazi_shared::fs::{Cha, FilesOp}; use crate::tab::Tab; diff --git a/yazi-core/src/tab/config.rs b/yazi-core/src/tab/config.rs index 49124e70..292a5f0d 100644 --- a/yazi-core/src/tab/config.rs +++ b/yazi-core/src/tab/config.rs @@ -1,4 +1,4 @@ -use yazi_config::{manager::SortBy, MANAGER}; +use yazi_config::{MANAGER, manager::SortBy}; use yazi_fs::FilesSorter; #[derive(Clone, PartialEq)] diff --git a/yazi-core/src/tab/preview.rs b/yazi-core/src/tab/preview.rs index 84d92386..a3cf2a82 100644 --- a/yazi-core/src/tab/preview.rs +++ b/yazi-core/src/tab/preview.rs @@ -1,13 +1,13 @@ use std::time::Duration; use tokio::{pin, task::JoinHandle}; -use tokio_stream::{wrappers::UnboundedReceiverStream, StreamExt}; +use tokio_stream::{StreamExt, wrappers::UnboundedReceiverStream}; use tokio_util::sync::CancellationToken; use yazi_adapter::ADAPTOR; use yazi_config::PLUGIN; use yazi_fs::Files; use yazi_plugin::{external::Highlighter, isolate, utils::PreviewLock}; -use yazi_shared::{fs::{Cha, File, FilesOp, Url}, MIME_DIR}; +use yazi_shared::{MIME_DIR, fs::{Cha, File, FilesOp, Url}}; #[derive(Default)] pub struct Preview { diff --git a/yazi-core/src/tab/tab.rs b/yazi-core/src/tab/tab.rs index 562c4484..6cac3e96 100644 --- a/yazi-core/src/tab/tab.rs +++ b/yazi-core/src/tab/tab.rs @@ -4,7 +4,7 @@ use anyhow::Result; use ratatui::layout::Rect; use tokio::task::JoinHandle; use yazi_adapter::Dimension; -use yazi_config::{popup::{Origin, Position}, LAYOUT}; +use yazi_config::{LAYOUT, popup::{Origin, Position}}; use yazi_fs::{Folder, FolderStage}; use yazi_shared::{fs::Url, render}; diff --git a/yazi-core/src/tasks/commands/inspect.rs b/yazi-core/src/tasks/commands/inspect.rs index 4828b913..003b45e1 100644 --- a/yazi-core/src/tasks/commands/inspect.rs +++ b/yazi-core/src/tasks/commands/inspect.rs @@ -1,8 +1,8 @@ -use std::{io::{stderr, BufWriter, LineWriter, Write}, mem}; +use std::{io::{BufWriter, LineWriter, Write, stderr}, mem}; use crossterm::terminal::{disable_raw_mode, enable_raw_mode}; use scopeguard::defer; -use tokio::{io::{stdin, AsyncReadExt}, select, sync::mpsc, time}; +use tokio::{io::{AsyncReadExt, stdin}, select, sync::mpsc, time}; use yazi_proxy::{AppProxy, HIDER}; use yazi_shared::{event::Cmd, terminal_clear}; diff --git a/yazi-core/src/tasks/preload.rs b/yazi-core/src/tasks/preload.rs index c8703f72..cc912b11 100644 --- a/yazi-core/src/tasks/preload.rs +++ b/yazi-core/src/tasks/preload.rs @@ -1,6 +1,6 @@ -use yazi_config::{manager::SortBy, plugin::MAX_PREWORKERS, PLUGIN}; +use yazi_config::{PLUGIN, manager::SortBy, plugin::MAX_PREWORKERS}; use yazi_fs::Files; -use yazi_shared::{fs::File, MIME_DIR}; +use yazi_shared::{MIME_DIR, fs::File}; use super::Tasks; use crate::manager::Mimetype; diff --git a/yazi-core/src/tasks/process.rs b/yazi-core/src/tasks/process.rs index 82b14ba4..d7116488 100644 --- a/yazi-core/src/tasks/process.rs +++ b/yazi-core/src/tasks/process.rs @@ -1,6 +1,6 @@ use std::{borrow::Cow, collections::HashMap, ffi::OsString, mem}; -use yazi_config::{open::Opener, OPEN}; +use yazi_config::{OPEN, open::Opener}; use yazi_shared::fs::Url; use super::Tasks; diff --git a/yazi-core/src/tasks/tasks.rs b/yazi-core/src/tasks/tasks.rs index e62fd0dd..fbc44149 100644 --- a/yazi-core/src/tasks/tasks.rs +++ b/yazi-core/src/tasks/tasks.rs @@ -4,9 +4,9 @@ use parking_lot::Mutex; use tokio::{task::JoinHandle, time::sleep}; use yazi_adapter::Dimension; use yazi_scheduler::{Ongoing, Scheduler, TaskSummary}; -use yazi_shared::{emit, event::Cmd, Layer}; +use yazi_shared::{Layer, emit, event::Cmd}; -use super::{TasksProgress, TASKS_BORDER, TASKS_PADDING, TASKS_PERCENT}; +use super::{TASKS_BORDER, TASKS_PADDING, TASKS_PERCENT, TasksProgress}; pub struct Tasks { pub(super) scheduler: Arc, diff --git a/yazi-core/src/which/commands/show.rs b/yazi-core/src/which/commands/show.rs index 8fcae121..8be966b4 100644 --- a/yazi-core/src/which/commands/show.rs +++ b/yazi-core/src/which/commands/show.rs @@ -1,7 +1,7 @@ use std::str::FromStr; -use yazi_config::{keymap::{Chord, Key}, KEYMAP}; -use yazi_shared::{event::Cmd, render, Layer}; +use yazi_config::{KEYMAP, keymap::{Chord, Key}}; +use yazi_shared::{Layer, event::Cmd, render}; use crate::which::{Which, WhichSorter}; diff --git a/yazi-core/src/which/sorter.rs b/yazi-core/src/which/sorter.rs index 5453f325..d6804872 100644 --- a/yazi-core/src/which/sorter.rs +++ b/yazi-core/src/which/sorter.rs @@ -1,7 +1,7 @@ use std::{borrow::Cow, mem}; -use yazi_config::{keymap::ChordCow, which::SortBy, WHICH}; -use yazi_shared::{natsort, Transliterator}; +use yazi_config::{WHICH, keymap::ChordCow, which::SortBy}; +use yazi_shared::{Transliterator, natsort}; #[derive(Clone, Copy, PartialEq)] pub struct WhichSorter { diff --git a/yazi-core/src/which/which.rs b/yazi-core/src/which/which.rs index 83cb2b87..c604a70f 100644 --- a/yazi-core/src/which/which.rs +++ b/yazi-core/src/which/which.rs @@ -1,5 +1,5 @@ use yazi_config::keymap::{ChordCow, Key}; -use yazi_shared::{emit, render, render_and, Layer}; +use yazi_shared::{Layer, emit, render, render_and}; #[derive(Default)] pub struct Which { diff --git a/yazi-dds/Cargo.toml b/yazi-dds/Cargo.toml index d31f8941..424da62e 100644 --- a/yazi-dds/Cargo.toml +++ b/yazi-dds/Cargo.toml @@ -28,7 +28,7 @@ tokio-util = { workspace = true } tracing = { workspace = true } [build-dependencies] -vergen-gitcl = { version = "1.0.0", features = [ "build" ] } +vergen-gitcl = { version = "1.0.1", features = [ "build" ] } [target."cfg(unix)".dependencies] uzers = { workspace = true } diff --git a/yazi-dds/src/body/body.rs b/yazi-dds/src/body/body.rs index 3f22a876..7fd6fb1e 100644 --- a/yazi-dds/src/body/body.rs +++ b/yazi-dds/src/body/body.rs @@ -1,4 +1,4 @@ -use anyhow::{bail, Result}; +use anyhow::{Result, bail}; use mlua::{ExternalResult, IntoLua, Lua, Value}; use serde::Serialize; diff --git a/yazi-dds/src/body/bulk.rs b/yazi-dds/src/body/bulk.rs index 47c8840a..cd9f33dd 100644 --- a/yazi-dds/src/body/bulk.rs +++ b/yazi-dds/src/body/bulk.rs @@ -1,4 +1,4 @@ -use std::{borrow::Cow, collections::{hash_map, HashMap}}; +use std::{borrow::Cow, collections::{HashMap, hash_map}}; use mlua::{AnyUserData, IntoLua, IntoLuaMulti, Lua, MetaMethod, UserData, UserDataRefMut, Value}; use serde::{Deserialize, Serialize}; diff --git a/yazi-dds/src/client.rs b/yazi-dds/src/client.rs index ed45f700..a2bc4950 100644 --- a/yazi-dds/src/client.rs +++ b/yazi-dds/src/client.rs @@ -1,13 +1,13 @@ use std::{collections::{HashMap, HashSet}, mem, str::FromStr}; -use anyhow::{bail, Context, Result}; +use anyhow::{Context, Result, bail}; use parking_lot::RwLock; use serde::{Deserialize, Serialize}; use tokio::{io::AsyncWriteExt, select, sync::mpsc, task::JoinHandle, time}; use tracing::error; use yazi_shared::RoCell; -use crate::{body::{Body, BodyBye, BodyHi}, ClientReader, ClientWriter, Payload, Pubsub, Server, Stream}; +use crate::{ClientReader, ClientWriter, Payload, Pubsub, Server, Stream, body::{Body, BodyBye, BodyHi}}; pub(super) static ID: RoCell = RoCell::new(); pub(super) static PEERS: RoCell>> = RoCell::new(); diff --git a/yazi-dds/src/payload.rs b/yazi-dds/src/payload.rs index 45459b33..41db5cdb 100644 --- a/yazi-dds/src/payload.rs +++ b/yazi-dds/src/payload.rs @@ -1,10 +1,10 @@ use std::{fmt::Display, io::Write, str::FromStr}; -use anyhow::{anyhow, Result}; +use anyhow::{Result, anyhow}; use yazi_boot::BOOT; -use yazi_shared::{emit, event::Cmd, Layer}; +use yazi_shared::{Layer, emit, event::Cmd}; -use crate::{body::Body, ID}; +use crate::{ID, body::Body}; #[derive(Debug)] pub struct Payload<'a> { diff --git a/yazi-dds/src/pubsub.rs b/yazi-dds/src/pubsub.rs index 2ade3415..59035c6e 100644 --- a/yazi-dds/src/pubsub.rs +++ b/yazi-dds/src/pubsub.rs @@ -3,9 +3,9 @@ use std::collections::{HashMap, HashSet}; use mlua::Function; use parking_lot::RwLock; use yazi_boot::BOOT; -use yazi_shared::{fs::Url, RoCell}; +use yazi_shared::{RoCell, fs::Url}; -use crate::{body::{Body, BodyBulk, BodyCd, BodyDelete, BodyHi, BodyHover, BodyMove, BodyMoveItem, BodyRename, BodyTab, BodyTrash, BodyYank}, Client, ID, PEERS}; +use crate::{Client, ID, PEERS, body::{Body, BodyBulk, BodyCd, BodyDelete, BodyHi, BodyHover, BodyMove, BodyMoveItem, BodyRename, BodyTab, BodyTrash, BodyYank}}; pub static LOCAL: RoCell>>>> = RoCell::new(); diff --git a/yazi-dds/src/pump.rs b/yazi-dds/src/pump.rs index 2a9ebb33..652cdaf8 100644 --- a/yazi-dds/src/pump.rs +++ b/yazi-dds/src/pump.rs @@ -2,11 +2,11 @@ use std::time::Duration; use parking_lot::Mutex; use tokio::{pin, select, sync::mpsc}; -use tokio_stream::{wrappers::UnboundedReceiverStream, StreamExt}; +use tokio_stream::{StreamExt, wrappers::UnboundedReceiverStream}; use tokio_util::sync::CancellationToken; -use yazi_shared::{fs::Url, RoCell}; +use yazi_shared::{RoCell, fs::Url}; -use crate::{body::BodyMoveItem, Pubsub}; +use crate::{Pubsub, body::BodyMoveItem}; static CT: RoCell = RoCell::new(); static MOVE_TX: Mutex>> = Mutex::new(None); diff --git a/yazi-dds/src/sendable.rs b/yazi-dds/src/sendable.rs index 337e6988..0a0335e7 100644 --- a/yazi-dds/src/sendable.rs +++ b/yazi-dds/src/sendable.rs @@ -1,7 +1,7 @@ use std::collections::HashMap; use mlua::{ExternalError, Lua, MultiValue, Table, Value}; -use yazi_shared::{event::{Data, DataKey}, OrderedFloat}; +use yazi_shared::{OrderedFloat, event::{Data, DataKey}}; pub struct Sendable; diff --git a/yazi-dds/src/server.rs b/yazi-dds/src/server.rs index 1e0ae37c..0d0c70d4 100644 --- a/yazi-dds/src/server.rs +++ b/yazi-dds/src/server.rs @@ -5,7 +5,7 @@ use parking_lot::RwLock; use tokio::{io::{AsyncBufReadExt, AsyncWriteExt, BufReader}, select, sync::mpsc::{self, UnboundedReceiver}, task::JoinHandle, time}; use yazi_shared::RoCell; -use crate::{body::{Body, BodyBye, BodyHey}, Client, ClientWriter, Payload, Peer, Stream, STATE}; +use crate::{Client, ClientWriter, Payload, Peer, STATE, Stream, body::{Body, BodyBye, BodyHey}}; pub(super) static CLIENTS: RoCell>> = RoCell::new(); diff --git a/yazi-dds/src/state.rs b/yazi-dds/src/state.rs index b0d30b35..13799f8f 100644 --- a/yazi-dds/src/state.rs +++ b/yazi-dds/src/state.rs @@ -4,7 +4,7 @@ use anyhow::Result; use parking_lot::RwLock; use tokio::{fs::{self, File, OpenOptions}, io::{AsyncBufReadExt, AsyncWriteExt, BufReader, BufWriter}}; use yazi_boot::BOOT; -use yazi_shared::{timestamp_us, RoCell}; +use yazi_shared::{RoCell, timestamp_us}; use crate::CLIENTS; diff --git a/yazi-fm/src/app/app.rs b/yazi-fm/src/app/app.rs index f28912bc..ea2d1adb 100644 --- a/yazi-fm/src/app/app.rs +++ b/yazi-fm/src/app/app.rs @@ -4,9 +4,9 @@ use anyhow::Result; use crossterm::event::KeyEvent; use yazi_config::keymap::Key; use yazi_core::input::InputMode; -use yazi_shared::{emit, event::{Cmd, Event, NEED_RENDER}, Layer}; +use yazi_shared::{Layer, emit, event::{Cmd, Event, NEED_RENDER}}; -use crate::{lives::Lives, Ctx, Executor, Router, Signals, Term}; +use crate::{Ctx, Executor, Router, Signals, Term, lives::Lives}; pub(crate) struct App { pub(crate) cx: Ctx, diff --git a/yazi-fm/src/app/commands/accept_payload.rs b/yazi-fm/src/app/commands/accept_payload.rs index 7048a6e5..4f88f167 100644 --- a/yazi-fm/src/app/commands/accept_payload.rs +++ b/yazi-fm/src/app/commands/accept_payload.rs @@ -1,6 +1,6 @@ use mlua::IntoLua; use tracing::error; -use yazi_dds::{Payload, LOCAL, REMOTE}; +use yazi_dds::{LOCAL, Payload, REMOTE}; use yazi_plugin::LUA; use yazi_shared::event::Cmd; diff --git a/yazi-fm/src/app/commands/mouse.rs b/yazi-fm/src/app/commands/mouse.rs index b124cb3e..f90c8716 100644 --- a/yazi-fm/src/app/commands/mouse.rs +++ b/yazi-fm/src/app/commands/mouse.rs @@ -2,7 +2,7 @@ use crossterm::event::{MouseEvent, MouseEventKind}; use mlua::{Table, TableExt}; use tracing::error; use yazi_config::MANAGER; -use yazi_plugin::{bindings::Cast, LUA}; +use yazi_plugin::{LUA, bindings::Cast}; use crate::{app::App, lives::Lives}; diff --git a/yazi-fm/src/app/commands/plugin.rs b/yazi-fm/src/app/commands/plugin.rs index 95ee0fb9..4c260487 100644 --- a/yazi-fm/src/app/commands/plugin.rs +++ b/yazi-fm/src/app/commands/plugin.rs @@ -4,8 +4,8 @@ use mlua::TableExt; use scopeguard::defer; use tracing::warn; use yazi_dds::Sendable; -use yazi_plugin::{loader::LOADER, RtRef, LUA}; -use yazi_shared::{emit, event::Cmd, Layer}; +use yazi_plugin::{LUA, RtRef, loader::LOADER}; +use yazi_shared::{Layer, emit, event::Cmd}; use crate::{app::App, lives::Lives}; diff --git a/yazi-fm/src/app/commands/quit.rs b/yazi-fm/src/app/commands/quit.rs index f83bc264..9d5224c8 100644 --- a/yazi-fm/src/app/commands/quit.rs +++ b/yazi-fm/src/app/commands/quit.rs @@ -3,7 +3,7 @@ use std::ffi::OsString; use yazi_boot::ARGS; use yazi_shared::event::EventQuit; -use crate::{app::App, Term}; +use crate::{Term, app::App}; impl App { pub(crate) fn quit(&mut self, opt: EventQuit) -> ! { diff --git a/yazi-fm/src/app/commands/render.rs b/yazi-fm/src/app/commands/render.rs index 589ad476..e61421e4 100644 --- a/yazi-fm/src/app/commands/render.rs +++ b/yazi-fm/src/app/commands/render.rs @@ -1,7 +1,7 @@ -use std::{io::{stderr, BufWriter}, sync::atomic::Ordering}; +use std::{io::{BufWriter, stderr}, sync::atomic::Ordering}; use crossterm::{execute, queue, terminal::{BeginSynchronizedUpdate, EndSynchronizedUpdate}}; -use ratatui::{backend::{Backend, CrosstermBackend}, buffer::Buffer, CompletedFrame}; +use ratatui::{CompletedFrame, backend::{Backend, CrosstermBackend}, buffer::Buffer}; use scopeguard::defer; use yazi_plugin::elements::COLLISION; diff --git a/yazi-fm/src/app/commands/resume.rs b/yazi-fm/src/app/commands/resume.rs index 1657df6c..fb3c5986 100644 --- a/yazi-fm/src/app/commands/resume.rs +++ b/yazi-fm/src/app/commands/resume.rs @@ -1,6 +1,6 @@ use yazi_shared::event::Cmd; -use crate::{app::App, Term}; +use crate::{Term, app::App}; impl App { pub(crate) fn resume(&mut self, _: Cmd) { diff --git a/yazi-fm/src/completion/completion.rs b/yazi-fm/src/completion/completion.rs index 1ee5cadd..e8963ef3 100644 --- a/yazi-fm/src/completion/completion.rs +++ b/yazi-fm/src/completion/completion.rs @@ -2,7 +2,7 @@ use std::path::MAIN_SEPARATOR; use ratatui::{buffer::Buffer, layout::Rect, widgets::{Block, BorderType, List, ListItem, Widget}}; use yazi_adapter::Dimension; -use yazi_config::{popup::{Offset, Position}, THEME}; +use yazi_config::{THEME, popup::{Offset, Position}}; use crate::Ctx; diff --git a/yazi-fm/src/components/progress.rs b/yazi-fm/src/components/progress.rs index 568a8275..a9423ff3 100644 --- a/yazi-fm/src/components/progress.rs +++ b/yazi-fm/src/components/progress.rs @@ -2,7 +2,7 @@ use std::mem; use mlua::{AnyUserData, Table, TableExt}; use tracing::error; -use yazi_plugin::{cast_to_renderable, LUA}; +use yazi_plugin::{LUA, cast_to_renderable}; pub(crate) struct Progress; diff --git a/yazi-fm/src/executor.rs b/yazi-fm/src/executor.rs index 5f2bc339..6b6addf7 100644 --- a/yazi-fm/src/executor.rs +++ b/yazi-fm/src/executor.rs @@ -1,5 +1,5 @@ use yazi_core::input::InputMode; -use yazi_shared::{event::Cmd, Layer}; +use yazi_shared::{Layer, event::Cmd}; use crate::app::App; diff --git a/yazi-fm/src/input/input.rs b/yazi-fm/src/input/input.rs index f82dea06..b4ecb558 100644 --- a/yazi-fm/src/input/input.rs +++ b/yazi-fm/src/input/input.rs @@ -1,6 +1,6 @@ use std::ops::Range; -use anyhow::{bail, Result}; +use anyhow::{Result, bail}; use ratatui::{buffer::Buffer, layout::Rect, text::Line, widgets::{Block, BorderType, Paragraph, Widget}}; use syntect::easy::HighlightLines; use yazi_config::{PREVIEW, THEME}; diff --git a/yazi-fm/src/lives/selected.rs b/yazi-fm/src/lives/selected.rs index 6310e147..3e446eaf 100644 --- a/yazi-fm/src/lives/selected.rs +++ b/yazi-fm/src/lives/selected.rs @@ -1,4 +1,4 @@ -use std::{collections::{hash_map, HashMap}, ops::Deref}; +use std::{collections::{HashMap, hash_map}, ops::Deref}; use mlua::{AnyUserData, IntoLuaMulti, Lua, MetaMethod, UserDataMethods, UserDataRefMut}; use yazi_plugin::{bindings::Cast, url::Url}; diff --git a/yazi-fm/src/lives/tab.rs b/yazi-fm/src/lives/tab.rs index 39b20224..aba84b33 100644 --- a/yazi-fm/src/lives/tab.rs +++ b/yazi-fm/src/lives/tab.rs @@ -3,7 +3,7 @@ use std::ops::Deref; use mlua::{AnyUserData, Lua, UserDataFields, UserDataMethods}; use yazi_plugin::url::UrlRef; -use super::{Config, Finder, Folder, Mode, Preview, Selected, SCOPE}; +use super::{Config, Finder, Folder, Mode, Preview, SCOPE, Selected}; pub(super) struct Tab { inner: *const yazi_core::tab::Tab, diff --git a/yazi-fm/src/lives/tabs.rs b/yazi-fm/src/lives/tabs.rs index 7b362a27..c95c1906 100644 --- a/yazi-fm/src/lives/tabs.rs +++ b/yazi-fm/src/lives/tabs.rs @@ -2,7 +2,7 @@ use std::ops::Deref; use mlua::{AnyUserData, Lua, MetaMethod, UserDataFields, UserDataMethods}; -use super::{Tab, SCOPE}; +use super::{SCOPE, Tab}; pub(super) struct Tabs { inner: *const yazi_core::manager::Tabs, diff --git a/yazi-fm/src/logs.rs b/yazi-fm/src/logs.rs index 3e2ceca8..9401a677 100644 --- a/yazi-fm/src/logs.rs +++ b/yazi-fm/src/logs.rs @@ -1,5 +1,5 @@ use tracing_appender::non_blocking::WorkerGuard; -use tracing_subscriber::{fmt, prelude::__tracing_subscriber_SubscriberExt, Registry}; +use tracing_subscriber::{Registry, fmt, prelude::__tracing_subscriber_SubscriberExt}; use yazi_shared::{RoCell, Xdg}; static _GUARD: RoCell = RoCell::new(); diff --git a/yazi-fm/src/root.rs b/yazi-fm/src/root.rs index d119b7be..723f6799 100644 --- a/yazi-fm/src/root.rs +++ b/yazi-fm/src/root.rs @@ -1,10 +1,10 @@ use mlua::{Table, TableExt}; use ratatui::{buffer::Buffer, layout::Rect, widgets::Widget}; use tracing::error; -use yazi_plugin::{bindings::Cast, elements::render_widgets, LUA}; +use yazi_plugin::{LUA, bindings::Cast, elements::render_widgets}; use super::{completion, confirm, input, select, tasks, which}; -use crate::{components, help, Ctx}; +use crate::{Ctx, components, help}; pub(super) struct Root<'a> { cx: &'a Ctx, diff --git a/yazi-fm/src/router.rs b/yazi-fm/src/router.rs index b9cc69c2..c6350a30 100644 --- a/yazi-fm/src/router.rs +++ b/yazi-fm/src/router.rs @@ -1,5 +1,5 @@ -use yazi_config::{keymap::{Chord, Key}, KEYMAP}; -use yazi_shared::{emit, Layer}; +use yazi_config::{KEYMAP, keymap::{Chord, Key}}; +use yazi_shared::{Layer, emit}; use crate::app::App; diff --git a/yazi-fm/src/term.rs b/yazi-fm/src/term.rs index 3f266f92..107699e1 100644 --- a/yazi-fm/src/term.rs +++ b/yazi-fm/src/term.rs @@ -1,10 +1,10 @@ -use std::{io::{self, stderr, BufWriter, Stderr}, ops::{Deref, DerefMut}, sync::atomic::{AtomicBool, AtomicU8, Ordering}}; +use std::{io::{self, BufWriter, Stderr, stderr}, ops::{Deref, DerefMut}, sync::atomic::{AtomicBool, AtomicU8, Ordering}}; use anyhow::Result; -use crossterm::{event::{DisableBracketedPaste, EnableBracketedPaste, KeyboardEnhancementFlags, PopKeyboardEnhancementFlags, PushKeyboardEnhancementFlags}, execute, queue, style::Print, terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen, SetTitle}}; +use crossterm::{event::{DisableBracketedPaste, EnableBracketedPaste, KeyboardEnhancementFlags, PopKeyboardEnhancementFlags, PushKeyboardEnhancementFlags}, execute, queue, style::Print, terminal::{EnterAlternateScreen, LeaveAlternateScreen, SetTitle, disable_raw_mode, enable_raw_mode}}; use cursor::RestoreCursor; -use ratatui::{backend::CrosstermBackend, buffer::Buffer, layout::Rect, CompletedFrame, Frame, Terminal}; -use yazi_adapter::{tcsi, Emulator}; +use ratatui::{CompletedFrame, Frame, Terminal, backend::CrosstermBackend, buffer::Buffer, layout::Rect}; +use yazi_adapter::{Emulator, tcsi}; use yazi_config::{INPUT, MANAGER}; static CSI_U: AtomicBool = AtomicBool::new(false); diff --git a/yazi-fm/src/which/cand.rs b/yazi-fm/src/which/cand.rs index 6d0c9e58..c47fa088 100644 --- a/yazi-fm/src/which/cand.rs +++ b/yazi-fm/src/which/cand.rs @@ -1,5 +1,5 @@ use ratatui::{buffer::Buffer, layout::Rect, text::{Line, Span}, widgets::Widget}; -use yazi_config::{keymap::Chord, THEME}; +use yazi_config::{THEME, keymap::Chord}; pub(super) struct Cand<'a> { cand: &'a Chord, diff --git a/yazi-fs/src/files.rs b/yazi-fs/src/files.rs index e153e084..3171d92a 100644 --- a/yazi-fs/src/files.rs +++ b/yazi-fs/src/files.rs @@ -1,8 +1,8 @@ use std::{collections::{HashMap, HashSet}, mem, ops::Deref, sync::atomic::Ordering}; use tokio::{fs::{self, DirEntry}, select, sync::mpsc::{self, UnboundedReceiver}}; -use yazi_config::{manager::SortBy, MANAGER}; -use yazi_shared::fs::{maybe_exists, Cha, File, FilesOp, Url, Urn, UrnBuf, FILES_TICKET}; +use yazi_config::{MANAGER, manager::SortBy}; +use yazi_shared::fs::{Cha, FILES_TICKET, File, FilesOp, Url, Urn, UrnBuf, maybe_exists}; use super::{FilesSorter, Filter}; diff --git a/yazi-fs/src/sorter.rs b/yazi-fs/src/sorter.rs index 377e5972..5e597839 100644 --- a/yazi-fs/src/sorter.rs +++ b/yazi-fs/src/sorter.rs @@ -1,7 +1,7 @@ use std::{cmp::Ordering, collections::HashMap, mem}; use yazi_config::manager::SortBy; -use yazi_shared::{fs::{File, UrnBuf}, natsort, LcgRng, Transliterator}; +use yazi_shared::{LcgRng, Transliterator, fs::{File, UrnBuf}, natsort}; #[derive(Clone, Copy, Default, PartialEq)] pub struct FilesSorter { diff --git a/yazi-plugin/src/bindings/input.rs b/yazi-plugin/src/bindings/input.rs index 90fccd29..245f6d00 100644 --- a/yazi-plugin/src/bindings/input.rs +++ b/yazi-plugin/src/bindings/input.rs @@ -1,6 +1,6 @@ use std::pin::Pin; -use mlua::{prelude::LuaUserDataMethods, UserData}; +use mlua::{UserData, prelude::LuaUserDataMethods}; use tokio::pin; use tokio_stream::StreamExt; use yazi_shared::InputError; diff --git a/yazi-plugin/src/bindings/permit.rs b/yazi-plugin/src/bindings/permit.rs index 4dfb0b6a..81555f0f 100644 --- a/yazi-plugin/src/bindings/permit.rs +++ b/yazi-plugin/src/bindings/permit.rs @@ -1,6 +1,6 @@ use std::{mem, ops::Deref}; -use mlua::{prelude::LuaUserDataMethods, UserData}; +use mlua::{UserData, prelude::LuaUserDataMethods}; use tokio::sync::SemaphorePermit; pub type PermitRef<'lua, F> = mlua::UserDataRef<'lua, Permit>; diff --git a/yazi-plugin/src/clipboard.rs b/yazi-plugin/src/clipboard.rs index 496617a3..43351b55 100644 --- a/yazi-plugin/src/clipboard.rs +++ b/yazi-plugin/src/clipboard.rs @@ -54,7 +54,7 @@ impl Clipboard { #[cfg(unix)] pub async fn set(&self, s: impl AsRef) { - use std::{io::{stderr, BufWriter}, process::Stdio}; + use std::{io::{BufWriter, stderr}, process::Stdio}; use crossterm::execute; use tokio::{io::AsyncWriteExt, process::Command}; @@ -109,7 +109,7 @@ impl Clipboard { mod osc52 { use std::ffi::OsStr; - use base64::{engine::general_purpose, Engine}; + use base64::{Engine, engine::general_purpose}; #[derive(Debug)] pub struct SetClipboard { diff --git a/yazi-plugin/src/external/highlighter.rs b/yazi-plugin/src/external/highlighter.rs index 697980f8..3f6831c3 100644 --- a/yazi-plugin/src/external/highlighter.rs +++ b/yazi-plugin/src/external/highlighter.rs @@ -1,10 +1,10 @@ use std::{borrow::Cow, io::Cursor, mem, path::{Path, PathBuf}, sync::atomic::{AtomicUsize, Ordering}}; -use anyhow::{anyhow, Result}; +use anyhow::{Result, anyhow}; use ratatui::{layout::Rect, text::{Line, Span, Text}}; -use syntect::{dumps, easy::HighlightLines, highlighting::{self, Theme, ThemeSet}, parsing::{SyntaxReference, SyntaxSet}, LoadingError}; +use syntect::{LoadingError, dumps, easy::HighlightLines, highlighting::{self, Theme, ThemeSet}, parsing::{SyntaxReference, SyntaxSet}}; use tokio::{fs::File, io::{AsyncBufReadExt, BufReader}, sync::OnceCell}; -use yazi_config::{preview::PreviewWrap, PREVIEW, THEME}; +use yazi_config::{PREVIEW, THEME, preview::PreviewWrap}; use yazi_shared::PeekError; static INCR: AtomicUsize = AtomicUsize::new(0); diff --git a/yazi-plugin/src/isolate/peek.rs b/yazi-plugin/src/isolate/peek.rs index e6a0d4be..bbb7be0b 100644 --- a/yazi-plugin/src/isolate/peek.rs +++ b/yazi-plugin/src/isolate/peek.rs @@ -3,10 +3,10 @@ use tokio::{runtime::Handle, select}; use tokio_util::sync::CancellationToken; use tracing::error; use yazi_config::LAYOUT; -use yazi_shared::{emit, event::Cmd, Layer}; +use yazi_shared::{Layer, emit, event::Cmd}; use super::slim_lua; -use crate::{bindings::{Cast, Window}, elements::Rect, file::File, loader::LOADER, Opt, OptCallback, LUA}; +use crate::{LUA, Opt, OptCallback, bindings::{Cast, Window}, elements::Rect, file::File, loader::LOADER}; pub fn peek(cmd: &Cmd, file: yazi_shared::fs::File, skip: usize) -> CancellationToken { let ct = CancellationToken::new(); diff --git a/yazi-plugin/src/isolate/seek.rs b/yazi-plugin/src/isolate/seek.rs index 32fa308b..ed5ef05f 100644 --- a/yazi-plugin/src/isolate/seek.rs +++ b/yazi-plugin/src/isolate/seek.rs @@ -1,8 +1,8 @@ use mlua::TableExt; use yazi_config::LAYOUT; -use yazi_shared::{emit, event::Cmd, Layer}; +use yazi_shared::{Layer, emit, event::Cmd}; -use crate::{bindings::Cast, elements::Rect, file::File, Opt, OptCallback, LUA}; +use crate::{LUA, Opt, OptCallback, bindings::Cast, elements::Rect, file::File}; pub fn seek_sync(cmd: &Cmd, file: yazi_shared::fs::File, units: i16) { let cb: OptCallback = Box::new(move |_, plugin| { diff --git a/yazi-plugin/src/process/command.rs b/yazi-plugin/src/process/command.rs index 8ed4f9fc..e502c0ba 100644 --- a/yazi-plugin/src/process/command.rs +++ b/yazi-plugin/src/process/command.rs @@ -3,7 +3,7 @@ use std::process::Stdio; use mlua::{AnyUserData, ExternalError, IntoLuaMulti, Lua, Table, UserData, Value}; use tokio::process::{ChildStderr, ChildStdin, ChildStdout}; -use super::{output::Output, Child}; +use super::{Child, output::Output}; use crate::process::Status; pub struct Command { diff --git a/yazi-plugin/src/utils/call.rs b/yazi-plugin/src/utils/call.rs index fa276035..4daacd15 100644 --- a/yazi-plugin/src/utils/call.rs +++ b/yazi-plugin/src/utils/call.rs @@ -4,7 +4,7 @@ use mlua::{ExternalError, Lua, Table, TableExt, Value}; use tracing::error; use yazi_config::LAYOUT; use yazi_dds::Sendable; -use yazi_shared::{emit, event::{Cmd, Data}, render, Layer}; +use yazi_shared::{Layer, emit, event::{Cmd, Data}, render}; use super::Utils; use crate::elements::RectRef; diff --git a/yazi-plugin/src/utils/image.rs b/yazi-plugin/src/utils/image.rs index 92d8c464..94edce3f 100644 --- a/yazi-plugin/src/utils/image.rs +++ b/yazi-plugin/src/utils/image.rs @@ -1,5 +1,5 @@ use mlua::{IntoLuaMulti, Lua, Table, Value}; -use yazi_adapter::{Image, ADAPTOR}; +use yazi_adapter::{ADAPTOR, Image}; use super::Utils; use crate::{bindings::Cast, elements::{Rect, RectRef}, url::UrlRef}; diff --git a/yazi-plugin/src/utils/layer.rs b/yazi-plugin/src/utils/layer.rs index 57a65508..1c8afd13 100644 --- a/yazi-plugin/src/utils/layer.rs +++ b/yazi-plugin/src/utils/layer.rs @@ -5,7 +5,7 @@ use tokio::sync::mpsc; use tokio_stream::wrappers::UnboundedReceiverStream; use yazi_config::{keymap::{Chord, Key}, popup::InputCfg}; use yazi_proxy::{AppProxy, InputProxy}; -use yazi_shared::{emit, event::Cmd, Debounce, Layer}; +use yazi_shared::{Debounce, Layer, emit, event::Cmd}; use super::Utils; use crate::bindings::{InputRx, Position}; diff --git a/yazi-plugin/src/utils/preview.rs b/yazi-plugin/src/utils/preview.rs index e41c540e..73157661 100644 --- a/yazi-plugin/src/utils/preview.rs +++ b/yazi-plugin/src/utils/preview.rs @@ -1,6 +1,6 @@ use mlua::{AnyUserData, IntoLuaMulti, Lua, Table, Value}; -use yazi_config::{preview::PreviewWrap, PREVIEW}; -use yazi_shared::{emit, event::Cmd, Layer, PeekError}; +use yazi_config::{PREVIEW, preview::PreviewWrap}; +use yazi_shared::{Layer, PeekError, emit, event::Cmd}; use super::Utils; use crate::{bindings::Window, cast_to_renderable, elements::{Paragraph, RectRef, Renderable, WRAP, WRAP_NO}, external::Highlighter, file::FileRef}; diff --git a/yazi-plugin/src/utils/sync.rs b/yazi-plugin/src/utils/sync.rs index 2322b6df..c5602489 100644 --- a/yazi-plugin/src/utils/sync.rs +++ b/yazi-plugin/src/utils/sync.rs @@ -1,10 +1,10 @@ use mlua::{ExternalError, ExternalResult, Function, Lua, MultiValue, Table, Value}; use tokio::sync::oneshot; use yazi_dds::Sendable; -use yazi_shared::{emit, event::{Cmd, Data}, Layer}; +use yazi_shared::{Layer, emit, event::{Cmd, Data}}; use super::Utils; -use crate::{loader::LOADER, runtime::RtRef, OptCallback}; +use crate::{OptCallback, loader::LOADER, runtime::RtRef}; impl Utils { pub(super) fn sync(lua: &'static Lua, ya: &Table) -> mlua::Result<()> { diff --git a/yazi-plugin/src/utils/user.rs b/yazi-plugin/src/utils/user.rs index c7449faf..d1845262 100644 --- a/yazi-plugin/src/utils/user.rs +++ b/yazi-plugin/src/utils/user.rs @@ -6,7 +6,7 @@ impl Utils { #[cfg(unix)] pub(super) fn user(lua: &Lua, ya: &Table) -> mlua::Result<()> { use uzers::{Groups, Users}; - use yazi_shared::{hostname, USERS_CACHE}; + use yazi_shared::{USERS_CACHE, hostname}; use crate::utils::HOSTNAME_CACHE; diff --git a/yazi-proxy/src/app.rs b/yazi-proxy/src/app.rs index 4763a36f..c9f79caf 100644 --- a/yazi-proxy/src/app.rs +++ b/yazi-proxy/src/app.rs @@ -1,7 +1,7 @@ use std::time::Duration; use tokio::sync::oneshot; -use yazi_shared::{emit, event::Cmd, Layer}; +use yazi_shared::{Layer, emit, event::Cmd}; use crate::options::{NotifyLevel, NotifyOpt}; diff --git a/yazi-proxy/src/completion.rs b/yazi-proxy/src/completion.rs index ca5c7174..915a4a19 100644 --- a/yazi-proxy/src/completion.rs +++ b/yazi-proxy/src/completion.rs @@ -1,4 +1,4 @@ -use yazi_shared::{emit, event::Cmd, Layer}; +use yazi_shared::{Layer, emit, event::Cmd}; pub struct CompletionProxy; diff --git a/yazi-proxy/src/confirm.rs b/yazi-proxy/src/confirm.rs index 60ecd93a..75c392fc 100644 --- a/yazi-proxy/src/confirm.rs +++ b/yazi-proxy/src/confirm.rs @@ -1,6 +1,6 @@ use tokio::sync::oneshot; use yazi_config::popup::ConfirmCfg; -use yazi_shared::{emit, event::Cmd, Layer}; +use yazi_shared::{Layer, emit, event::Cmd}; pub struct ConfirmProxy; diff --git a/yazi-proxy/src/input.rs b/yazi-proxy/src/input.rs index 46a97267..6e74894c 100644 --- a/yazi-proxy/src/input.rs +++ b/yazi-proxy/src/input.rs @@ -1,6 +1,6 @@ use tokio::sync::mpsc; use yazi_config::popup::InputCfg; -use yazi_shared::{emit, event::Cmd, InputError, Layer}; +use yazi_shared::{InputError, Layer, emit, event::Cmd}; pub struct InputProxy; diff --git a/yazi-proxy/src/manager.rs b/yazi-proxy/src/manager.rs index 85fca9ad..1974e183 100644 --- a/yazi-proxy/src/manager.rs +++ b/yazi-proxy/src/manager.rs @@ -1,4 +1,4 @@ -use yazi_shared::{emit, event::Cmd, fs::Url, Layer}; +use yazi_shared::{Layer, emit, event::Cmd, fs::Url}; use crate::options::OpenDoOpt; diff --git a/yazi-proxy/src/select.rs b/yazi-proxy/src/select.rs index 76ab61b7..32b62f98 100644 --- a/yazi-proxy/src/select.rs +++ b/yazi-proxy/src/select.rs @@ -1,6 +1,6 @@ use tokio::sync::oneshot; use yazi_config::popup::SelectCfg; -use yazi_shared::{emit, event::Cmd, Layer}; +use yazi_shared::{Layer, emit, event::Cmd}; pub struct SelectProxy; diff --git a/yazi-proxy/src/tab.rs b/yazi-proxy/src/tab.rs index 977deaad..9c271e88 100644 --- a/yazi-proxy/src/tab.rs +++ b/yazi-proxy/src/tab.rs @@ -1,4 +1,4 @@ -use yazi_shared::{emit, event::Cmd, fs::Url, Layer}; +use yazi_shared::{Layer, emit, event::Cmd, fs::Url}; use crate::options::SearchOpt; diff --git a/yazi-proxy/src/tasks.rs b/yazi-proxy/src/tasks.rs index 10f0f9ca..9ca53be6 100644 --- a/yazi-proxy/src/tasks.rs +++ b/yazi-proxy/src/tasks.rs @@ -2,7 +2,7 @@ use std::{borrow::Cow, ffi::OsString}; use tokio::sync::oneshot; use yazi_config::open::Opener; -use yazi_shared::{emit, event::Cmd, fs::Url, Layer}; +use yazi_shared::{Layer, emit, event::Cmd, fs::Url}; use crate::options::{OpenWithOpt, ProcessExecOpt}; diff --git a/yazi-scheduler/src/file/file.rs b/yazi-scheduler/src/file/file.rs index 24e80902..cdb2f6a3 100644 --- a/yazi-scheduler/src/file/file.rs +++ b/yazi-scheduler/src/file/file.rs @@ -1,13 +1,13 @@ use std::{borrow::Cow, collections::VecDeque, fs::Metadata, path::{Path, PathBuf}}; -use anyhow::{anyhow, Result}; +use anyhow::{Result, anyhow}; use tokio::{fs, io::{self, ErrorKind::{AlreadyExists, NotFound}}, sync::mpsc}; use tracing::warn; use yazi_config::TASKS; -use yazi_shared::fs::{calculate_size, copy_with_progress, maybe_exists, ok_or_not_found, path_relative_to, Url}; +use yazi_shared::fs::{Url, calculate_size, copy_with_progress, maybe_exists, ok_or_not_found, path_relative_to}; use super::{FileOp, FileOpDelete, FileOpHardlink, FileOpLink, FileOpPaste, FileOpTrash}; -use crate::{TaskOp, TaskProg, LOW, NORMAL}; +use crate::{LOW, NORMAL, TaskOp, TaskProg}; pub struct File { macro_: async_priority_channel::Sender, @@ -131,7 +131,7 @@ impl File { tokio::task::spawn_blocking(move || { #[cfg(target_os = "macos")] { - use trash::{macos::{DeleteMethod, TrashContextExtMacos}, TrashContext}; + use trash::{TrashContext, macos::{DeleteMethod, TrashContextExtMacos}}; let mut ctx = TrashContext::default(); ctx.set_delete_method(DeleteMethod::NsFileManager); ctx.delete(&task.target)?; diff --git a/yazi-scheduler/src/plugin/plugin.rs b/yazi-scheduler/src/plugin/plugin.rs index f037dd06..eb6fdf3d 100644 --- a/yazi-scheduler/src/plugin/plugin.rs +++ b/yazi-scheduler/src/plugin/plugin.rs @@ -1,9 +1,9 @@ -use anyhow::{anyhow, Result}; +use anyhow::{Result, anyhow}; use tokio::sync::mpsc; use yazi_plugin::isolate; use super::{PluginOp, PluginOpEntry}; -use crate::{TaskOp, TaskProg, HIGH}; +use crate::{HIGH, TaskOp, TaskProg}; pub struct Plugin { macro_: async_priority_channel::Sender, diff --git a/yazi-scheduler/src/prework/op.rs b/yazi-scheduler/src/prework/op.rs index 1b9fb278..eb95508f 100644 --- a/yazi-scheduler/src/prework/op.rs +++ b/yazi-scheduler/src/prework/op.rs @@ -1,7 +1,7 @@ use std::sync::Arc; use yazi_config::plugin::{FetcherProps, PreloaderProps}; -use yazi_shared::{fs::Url, Throttle}; +use yazi_shared::{Throttle, fs::Url}; #[derive(Debug)] pub enum PreworkOp { diff --git a/yazi-scheduler/src/prework/prework.rs b/yazi-scheduler/src/prework/prework.rs index 28bc3776..a936d208 100644 --- a/yazi-scheduler/src/prework/prework.rs +++ b/yazi-scheduler/src/prework/prework.rs @@ -1,15 +1,15 @@ use std::collections::{HashMap, HashSet}; -use anyhow::{anyhow, Result}; +use anyhow::{Result, anyhow}; use parking_lot::{Mutex, RwLock}; use tokio::sync::mpsc; use tracing::error; use yazi_config::Priority; use yazi_plugin::isolate; -use yazi_shared::fs::{calculate_size, FilesOp, Url}; +use yazi_shared::fs::{FilesOp, Url, calculate_size}; use super::{PreworkOp, PreworkOpFetch, PreworkOpLoad, PreworkOpSize}; -use crate::{TaskOp, TaskProg, HIGH, NORMAL}; +use crate::{HIGH, NORMAL, TaskOp, TaskProg}; pub struct Prework { macro_: async_priority_channel::Sender, diff --git a/yazi-scheduler/src/scheduler.rs b/yazi-scheduler/src/scheduler.rs index 769b1431..644918e4 100644 --- a/yazi-scheduler/src/scheduler.rs +++ b/yazi-scheduler/src/scheduler.rs @@ -1,16 +1,16 @@ use std::{borrow::Cow, ffi::OsString, sync::Arc, time::Duration}; use anyhow::Result; -use futures::{future::BoxFuture, FutureExt}; +use futures::{FutureExt, future::BoxFuture}; use parking_lot::Mutex; use tokio::{fs, select, sync::{mpsc::{self, UnboundedReceiver}, oneshot}, task::JoinHandle}; -use yazi_config::{open::Opener, plugin::{Fetcher, Preloader}, TASKS}; +use yazi_config::{TASKS, open::Opener, plugin::{Fetcher, Preloader}}; use yazi_dds::Pump; use yazi_proxy::ManagerProxy; -use yazi_shared::{event::Data, fs::{remove_dir_clean, unique_name, Url}, Throttle}; +use yazi_shared::{Throttle, event::Data, fs::{Url, remove_dir_clean, unique_name}}; use super::{Ongoing, TaskProg, TaskStage}; -use crate::{file::{File, FileOpDelete, FileOpHardlink, FileOpLink, FileOpPaste, FileOpTrash}, plugin::{Plugin, PluginOpEntry}, prework::{Prework, PreworkOpFetch, PreworkOpLoad, PreworkOpSize}, process::{Process, ProcessOpBg, ProcessOpBlock, ProcessOpOrphan}, TaskKind, TaskOp, HIGH, LOW, NORMAL}; +use crate::{HIGH, LOW, NORMAL, TaskKind, TaskOp, file::{File, FileOpDelete, FileOpHardlink, FileOpLink, FileOpPaste, FileOpTrash}, plugin::{Plugin, PluginOpEntry}, prework::{Prework, PreworkOpFetch, PreworkOpLoad, PreworkOpSize}, process::{Process, ProcessOpBg, ProcessOpBlock, ProcessOpOrphan}}; pub struct Scheduler { pub file: Arc, diff --git a/yazi-shared/src/condition.rs b/yazi-shared/src/condition.rs index 5106e5a1..eab1ddd8 100644 --- a/yazi-shared/src/condition.rs +++ b/yazi-shared/src/condition.rs @@ -1,7 +1,7 @@ use std::str::FromStr; use anyhow::bail; -use serde::{de, Deserialize, Deserializer}; +use serde::{Deserialize, Deserializer, de}; #[derive(Debug, PartialEq, Eq)] pub enum ConditionOp { diff --git a/yazi-shared/src/debounce.rs b/yazi-shared/src/debounce.rs index dce640a2..a4cb6d0f 100644 --- a/yazi-shared/src/debounce.rs +++ b/yazi-shared/src/debounce.rs @@ -1,7 +1,7 @@ use std::{pin::Pin, task::{Context, Poll}, time::Duration}; use futures::{FutureExt, Stream, StreamExt}; -use tokio::time::{sleep, Instant, Sleep}; +use tokio::time::{Instant, Sleep, sleep}; pub struct Debounce where diff --git a/yazi-shared/src/event/cmd.rs b/yazi-shared/src/event/cmd.rs index 10ae9304..66701b7b 100644 --- a/yazi-shared/src/event/cmd.rs +++ b/yazi-shared/src/event/cmd.rs @@ -1,7 +1,7 @@ use std::{any::Any, collections::HashMap, fmt::{self, Display}, mem, str::FromStr}; use anyhow::bail; -use serde::{de, Deserialize}; +use serde::{Deserialize, de}; use super::Data; diff --git a/yazi-shared/src/event/data.rs b/yazi-shared/src/event/data.rs index 1cd61833..558d34ff 100644 --- a/yazi-shared/src/event/data.rs +++ b/yazi-shared/src/event/data.rs @@ -2,7 +2,7 @@ use std::{any::Any, collections::HashMap}; use serde::{Deserialize, Serialize}; -use crate::{fs::Url, OrderedFloat}; +use crate::{OrderedFloat, fs::Url}; // --- Data #[derive(Debug, Serialize, Deserialize)] diff --git a/yazi-shared/src/fs/fns.rs b/yazi-shared/src/fs/fns.rs index ec377030..82b2fe77 100644 --- a/yazi-shared/src/fs/fns.rs +++ b/yazi-shared/src/fs/fns.rs @@ -1,6 +1,6 @@ use std::{borrow::Cow, collections::{HashMap, HashSet, VecDeque}, ffi::{OsStr, OsString}, fs::Metadata, path::{Path, PathBuf}}; -use anyhow::{bail, Result}; +use anyhow::{Result, bail}; use tokio::{fs, io, select, sync::{mpsc, oneshot}, time}; #[inline] @@ -44,7 +44,7 @@ async fn _paths_to_same_file(a: &Path, b: &Path) -> io::Result { async fn _paths_to_same_file(a: &Path, b: &Path) -> std::io::Result { use std::os::windows::{ffi::OsStringExt, io::AsRawHandle}; - use windows_sys::Win32::{Foundation::{HANDLE, MAX_PATH}, Storage::FileSystem::{GetFinalPathNameByHandleW, FILE_FLAG_BACKUP_SEMANTICS, FILE_FLAG_OPEN_REPARSE_POINT, VOLUME_NAME_DOS}}; + use windows_sys::Win32::{Foundation::{HANDLE, MAX_PATH}, Storage::FileSystem::{FILE_FLAG_BACKUP_SEMANTICS, FILE_FLAG_OPEN_REPARSE_POINT, GetFinalPathNameByHandleW, VOLUME_NAME_DOS}}; async fn final_name(p: &Path) -> std::io::Result { let file = tokio::fs::OpenOptions::new() diff --git a/yazi-shared/src/fs/op.rs b/yazi-shared/src/fs/op.rs index 74238923..b51e86dd 100644 --- a/yazi-shared/src/fs/op.rs +++ b/yazi-shared/src/fs/op.rs @@ -1,7 +1,7 @@ use std::{collections::{HashMap, HashSet}, sync::atomic::{AtomicU64, Ordering}}; use super::{Cha, File, UrnBuf}; -use crate::{emit, event::Cmd, fs::Url, Layer}; +use crate::{Layer, emit, event::Cmd, fs::Url}; pub static FILES_TICKET: AtomicU64 = AtomicU64::new(0); diff --git a/yazi-shared/src/fs/url.rs b/yazi-shared/src/fs/url.rs index a34662b1..bebe9288 100644 --- a/yazi-shared/src/fs/url.rs +++ b/yazi-shared/src/fs/url.rs @@ -1,6 +1,6 @@ use std::{ffi::OsStr, fmt::{Debug, Display, Formatter}, ops::Deref, path::{Path, PathBuf}}; -use percent_encoding::{percent_decode_str, percent_encode, AsciiSet, CONTROLS}; +use percent_encoding::{AsciiSet, CONTROLS, percent_decode_str, percent_encode}; use serde::{Deserialize, Serialize}; use super::{Loc, UrnBuf}; diff --git a/yazi-shared/src/theme/color.rs b/yazi-shared/src/theme/color.rs index 97c357be..b3abc16f 100644 --- a/yazi-shared/src/theme/color.rs +++ b/yazi-shared/src/theme/color.rs @@ -1,6 +1,6 @@ use std::str::FromStr; -use anyhow::{anyhow, Result}; +use anyhow::{Result, anyhow}; use serde::{Deserialize, Serialize}; #[derive(Clone, Copy, Debug, Deserialize)] diff --git a/yazi-shared/src/theme/style.rs b/yazi-shared/src/theme/style.rs index 529d4e2e..e54ed176 100644 --- a/yazi-shared/src/theme/style.rs +++ b/yazi-shared/src/theme/style.rs @@ -1,5 +1,5 @@ use ratatui::style::Modifier; -use serde::{ser::SerializeMap, Deserialize, Serialize, Serializer}; +use serde::{Deserialize, Serialize, Serializer, ser::SerializeMap}; use super::Color;