diff --git a/Cargo.lock b/Cargo.lock index 73f9a7a5b..814a4b7b1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -34,9 +34,9 @@ checksum = "4aa90d7ce82d4be67b64039a3d588d38dbcc6736577de4a847025ce5b0c468d1" [[package]] name = "allocator-api2" -version = "0.2.20" +version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45862d1c77f2228b9e10bc609d5bc203d86ebc9b87ad8d5d5167a6c9abf739d9" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" [[package]] name = "android-tzdata" @@ -135,7 +135,7 @@ checksum = "0ae92a5119aa49cdbcf6b9f893fe4e1d98b04ccbf82ee0584ad948a44a734dea" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn", ] [[package]] @@ -306,9 +306,9 @@ checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" [[package]] name = "bytes" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" +checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" [[package]] name = "cassowary" @@ -327,9 +327,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.1" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd9de9f2205d5ef3fd67e685b0df337994ddd4495e2a28d185500d0e1edfea47" +checksum = "f34d93e62b03caf570cccc334cbc6c2fceca82f39211051345108adcba3eebdc" dependencies = [ "jobserver", "libc", @@ -424,7 +424,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.89", + "syn", ] [[package]] @@ -603,7 +603,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.89", + "syn", ] [[package]] @@ -614,7 +614,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.89", + "syn", ] [[package]] @@ -644,7 +644,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.89", + "syn", ] [[package]] @@ -654,7 +654,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab63b0e2bf4d5928aff72e83a7dace85d7bba5fe12dcc3c5a572d78caffd3f3c" dependencies = [ "derive_builder_core", - "syn 2.0.89", + "syn", ] [[package]] @@ -702,7 +702,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn", ] [[package]] @@ -735,12 +735,12 @@ dependencies = [ [[package]] name = "errno" -version = "0.3.9" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -913,7 +913,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn", ] [[package]] @@ -1023,12 +1023,6 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" -[[package]] -name = "hermit-abi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" - [[package]] name = "home" version = "0.5.9" @@ -1176,7 +1170,7 @@ checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn", ] [[package]] @@ -1245,9 +1239,9 @@ checksum = "d0263a3d970d5c054ed9312c0057b4f3bde9c0b33836d3637361d4a9e6e7a408" [[package]] name = "indexmap" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" +checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" dependencies = [ "equivalent", "hashbrown", @@ -1291,7 +1285,7 @@ dependencies = [ "pretty_assertions", "proc-macro2", "quote", - "syn 2.0.89", + "syn", ] [[package]] @@ -1311,7 +1305,7 @@ checksum = "c34819042dc3d3971c46c2190835914dfbe0c3c13f61449b2997f4e9722dfa60" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn", ] [[package]] @@ -1355,10 +1349,11 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.72" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" +checksum = "a865e038f7f6ed956f788f0d7d60c541fff74c7bd74272c5d4cf15c63743e705" dependencies = [ + "once_cell", "wasm-bindgen", ] @@ -1396,9 +1391,9 @@ checksum = "03087c2bad5e1034e8cace5926dec053fb3790248370865f5117a7d0213354c8" [[package]] name = "libc" -version = "0.2.166" +version = "0.2.167" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2ccc108bbc0b1331bd061864e7cd823c0cab660bbe6970e66e2c0614decde36" +checksum = "09d6582e104315a817dff97f75133544b2e094ee22447d2acf4a74e189ba06fc" [[package]] name = "libfuzzer-sys" @@ -1538,11 +1533,10 @@ dependencies = [ [[package]] name = "mio" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" +checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" dependencies = [ - "hermit-abi", "libc", "log", "wasi", @@ -1551,9 +1545,9 @@ dependencies = [ [[package]] name = "mlua" -version = "0.10.1" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ae9546e4a268c309804e8bbb7526e31cbfdedca7cd60ac1b987d0b212e0d876" +checksum = "9ea43c3ffac2d0798bd7128815212dd78c98316b299b7a902dabef13dc7b6b8d" dependencies = [ "anyhow", "bstr", @@ -1571,9 +1565,9 @@ dependencies = [ [[package]] name = "mlua-sys" -version = "0.6.5" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efa6bf1a64f06848749b7e7727417f4ec2121599e2a10ef0a8a3888b0e9a5a0d" +checksum = "63a11d485edf0f3f04a508615d36c7d50d299cf61a7ee6d3e2530651e0a31771" dependencies = [ "cc", "cfg-if", @@ -1584,17 +1578,17 @@ dependencies = [ [[package]] name = "mlua_derive" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cfc5faa2e0d044b3f5f0879be2920e0a711c97744c42cf1c295cb183668933e" +checksum = "870d71c172fcf491c6b5fb4c04160619a2ee3e5a42a1402269c66bcbf1dd4deb" dependencies = [ "itertools 0.13.0", "once_cell", - "proc-macro-error", + "proc-macro-error2", "proc-macro2", "quote", "regex", - "syn 2.0.89", + "syn", ] [[package]] @@ -1681,7 +1675,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn", ] [[package]] @@ -1924,30 +1918,6 @@ dependencies = [ "yansi", ] -[[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn 1.0.109", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", -] - [[package]] name = "proc-macro-error-attr2" version = "2.0.0" @@ -1967,7 +1937,7 @@ dependencies = [ "proc-macro-error-attr2", "proc-macro2", "quote", - "syn 2.0.89", + "syn", ] [[package]] @@ -1995,7 +1965,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a65f2e60fbf1063868558d69c6beacf412dc755f9fc020f514b7955fc914fe30" dependencies = [ "quote", - "syn 2.0.89", + "syn", ] [[package]] @@ -2219,9 +2189,9 @@ checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc-hash" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" +checksum = "c7fb8039b3032c191086b10f11f319a6e99e1e82889c5cc6046f515c9db1d497" [[package]] name = "rustc_version" @@ -2305,7 +2275,7 @@ checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn", ] [[package]] @@ -2475,24 +2445,14 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.89", -] - -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "unicode-ident", + "syn", ] [[package]] name = "syn" -version = "2.0.89" +version = "2.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d46482f1c1c87acd84dea20c1bf5ebff4c757009ed6bf19cfd36fb10e92c4e" +checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" dependencies = [ "proc-macro2", "quote", @@ -2507,7 +2467,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn", ] [[package]] @@ -2567,7 +2527,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn", ] [[package]] @@ -2669,7 +2629,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn", ] [[package]] @@ -2762,7 +2722,7 @@ checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn", ] [[package]] @@ -2788,9 +2748,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.18" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" dependencies = [ "matchers", "nu-ansi-term", @@ -2951,7 +2911,7 @@ dependencies = [ "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.89", + "syn", ] [[package]] @@ -3029,9 +2989,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.95" +version = "0.2.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" +checksum = "d15e63b4482863c109d70a7b8706c1e364eb6ea449b201a76c5b89cedcec2d5c" dependencies = [ "cfg-if", "once_cell", @@ -3040,24 +3000,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.95" +version = "0.2.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" +checksum = "8d36ef12e3aaca16ddd3f67922bc63e48e953f126de60bd33ccc0101ef9998cd" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.89", + "syn", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.95" +version = "0.2.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" +checksum = "705440e08b42d3e4b36de7d66c944be628d579796b8090bfa3471478a2260051" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3065,22 +3025,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.95" +version = "0.2.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" +checksum = "98c9ae5a76e46f4deecd0f0255cc223cfa18dc9b261213b8aa0c7b36f61b3f1d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.95" +version = "0.2.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" +checksum = "6ee99da9c5ba11bd675621338ef6fa52296b76b83305e9b6e5c77d4c286d6d49" [[package]] name = "weezl" @@ -3170,7 +3130,7 @@ checksum = "f6fc35f58ecd95a9b71c4f2329b911016e6bec66b3f2e6a4aad86bd2e99e2f9b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn", ] [[package]] @@ -3181,7 +3141,7 @@ checksum = "08990546bf4edef8f431fa6326e032865f27138718c587dc21bc0265bbcb57cc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn", ] [[package]] @@ -3437,7 +3397,7 @@ name = "yazi-codegen" version = "0.3.3" dependencies = [ "quote", - "syn 2.0.89", + "syn", ] [[package]] @@ -3680,7 +3640,7 @@ checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn", "synstructure", ] @@ -3702,7 +3662,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn", ] [[package]] @@ -3722,7 +3682,7 @@ checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn", "synstructure", ] @@ -3745,7 +3705,7 @@ checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 624047721..fdcfbbff9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,9 +19,9 @@ crossterm = { version = "0.28.1", features = [ "event-stream" ] } dirs = "5.0.1" futures = "0.3.31" globset = "0.4.15" -libc = "0.2.166" +libc = "0.2.167" md-5 = "0.10.6" -mlua = { version = "0.10.1", features = [ "anyhow", "async", "error-send", "lua54", "macros", "serialize" ] } +mlua = { version = "0.10.2", features = [ "anyhow", "async", "error-send", "lua54", "macros", "serialize" ] } parking_lot = "0.12.3" ratatui = { version = "0.29.0", features = [ "unstable-rendered-line-info" ] } regex = "1.11.1" diff --git a/yazi-codegen/Cargo.toml b/yazi-codegen/Cargo.toml index ce5663136..8bb0ab447 100644 --- a/yazi-codegen/Cargo.toml +++ b/yazi-codegen/Cargo.toml @@ -13,5 +13,5 @@ proc-macro = true [dependencies] # External dependencies -syn = "2.0.89" +syn = "2.0.90" quote = "1.0.37" diff --git a/yazi-config/Cargo.toml b/yazi-config/Cargo.toml index e6037f099..5d4a02571 100644 --- a/yazi-config/Cargo.toml +++ b/yazi-config/Cargo.toml @@ -17,7 +17,7 @@ anyhow = { workspace = true } bitflags = { workspace = true } crossterm = { workspace = true } globset = { workspace = true } -indexmap = { version = "2.6.0", features = [ "serde" ] } +indexmap = { version = "2.7.0", features = [ "serde" ] } ratatui = { workspace = true } regex = { workspace = true } serde = { workspace = true } diff --git a/yazi-config/src/popup/options.rs b/yazi-config/src/popup/options.rs index c97a640c7..b1d4b550b 100644 --- a/yazi-config/src/popup/options.rs +++ b/yazi-config/src/popup/options.rs @@ -1,5 +1,5 @@ use ratatui::{text::Text, widgets::{Paragraph, Wrap}}; -use yazi_shared::fs::Url; +use yazi_shared::url::Url; use super::{Offset, Origin, Position}; use crate::{CONFIRM, INPUT, PICK}; @@ -119,7 +119,7 @@ impl ConfirmCfg { } } - pub fn trash(urls: &[yazi_shared::fs::Url]) -> Self { + pub fn trash(urls: &[yazi_shared::url::Url]) -> Self { Self::new( Self::replace_number(&CONFIRM.trash_title, urls.len()), (CONFIRM.trash_origin, CONFIRM.trash_offset), @@ -128,7 +128,7 @@ impl ConfirmCfg { ) } - pub fn delete(urls: &[yazi_shared::fs::Url]) -> Self { + pub fn delete(urls: &[yazi_shared::url::Url]) -> Self { Self::new( Self::replace_number(&CONFIRM.delete_title, urls.len()), (CONFIRM.delete_origin, CONFIRM.delete_offset), diff --git a/yazi-core/src/manager/commands/bulk_rename.rs b/yazi-core/src/manager/commands/bulk_rename.rs index e8e4adf10..13f0b3976 100644 --- a/yazi-core/src/manager/commands/bulk_rename.rs +++ b/yazi-core/src/manager/commands/bulk_rename.rs @@ -6,7 +6,7 @@ use tokio::{fs::{self, OpenOptions}, io::{AsyncReadExt, AsyncWriteExt, stdin}}; use yazi_config::{OPEN, PREVIEW}; use yazi_dds::Pubsub; use yazi_proxy::{AppProxy, HIDER, TasksProxy, WATCHER}; -use yazi_shared::{fs::{File, FilesOp, Url, max_common_root, maybe_exists, paths_to_same_file}, terminal_clear}; +use yazi_shared::{fs::{File, FilesOp, max_common_root, maybe_exists, paths_to_same_file}, terminal_clear, url::Url}; use crate::manager::Manager; diff --git a/yazi-core/src/manager/commands/create.rs b/yazi-core/src/manager/commands/create.rs index 1ef423bde..89eb96a33 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::CmdCow, fs::{File, FilesOp, Url, UrnBuf, maybe_exists, ok_or_not_found, realname}}; +use yazi_shared::{event::CmdCow, fs::{File, FilesOp, maybe_exists, ok_or_not_found, realname}, url::{Url, UrnBuf}}; use crate::manager::Manager; diff --git a/yazi-core/src/manager/commands/hover.rs b/yazi-core/src/manager/commands/hover.rs index ef0f7e578..b24f65136 100644 --- a/yazi-core/src/manager/commands/hover.rs +++ b/yazi-core/src/manager/commands/hover.rs @@ -2,7 +2,7 @@ use std::{collections::HashSet, path::PathBuf}; use yazi_dds::Pubsub; use yazi_macro::render; -use yazi_shared::{Id, event::{CmdCow, Data}, fs::{Url, Urn}}; +use yazi_shared::{Id, event::{CmdCow, Data}, url::{Url, Urn}}; use crate::manager::Manager; diff --git a/yazi-core/src/manager/commands/open.rs b/yazi-core/src/manager/commands/open.rs index 7e8a93803..12e455a6b 100644 --- a/yazi-core/src/manager/commands/open.rs +++ b/yazi-core/src/manager/commands/open.rs @@ -7,7 +7,7 @@ use yazi_fs::Folder; use yazi_macro::emit; use yazi_plugin::isolate; use yazi_proxy::{ManagerProxy, TasksProxy, options::OpenDoOpt}; -use yazi_shared::{MIME_DIR, event::{CmdCow, EventQuit}, fs::{File, Url}}; +use yazi_shared::{MIME_DIR, event::{CmdCow, EventQuit}, fs::File, url::Url}; use crate::{manager::Manager, tasks::Tasks}; diff --git a/yazi-core/src/manager/commands/peek.rs b/yazi-core/src/manager/commands/peek.rs index c967b0be2..c4d7502b8 100644 --- a/yazi-core/src/manager/commands/peek.rs +++ b/yazi-core/src/manager/commands/peek.rs @@ -1,5 +1,5 @@ use yazi_proxy::HIDER; -use yazi_shared::{event::{CmdCow, Data}, fs::Url}; +use yazi_shared::{event::{CmdCow, Data}, url::Url}; use crate::manager::Manager; diff --git a/yazi-core/src/manager/commands/remove.rs b/yazi-core/src/manager/commands/remove.rs index fd8906558..8a391710e 100644 --- a/yazi-core/src/manager/commands/remove.rs +++ b/yazi-core/src/manager/commands/remove.rs @@ -1,6 +1,6 @@ use yazi_config::popup::ConfirmCfg; use yazi_proxy::{ConfirmProxy, ManagerProxy}; -use yazi_shared::{event::CmdCow, fs::Url}; +use yazi_shared::{event::CmdCow, url::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 2669aecc4..489f5386a 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::CmdCow, fs::{File, FilesOp, Url, UrnBuf, maybe_exists, ok_or_not_found, paths_to_same_file, realname}}; +use yazi_shared::{event::CmdCow, fs::{File, FilesOp, maybe_exists, ok_or_not_found, paths_to_same_file, realname}, url::{Url, UrnBuf}}; use crate::manager::Manager; diff --git a/yazi-core/src/manager/commands/tab_create.rs b/yazi-core/src/manager/commands/tab_create.rs index 76acc4d77..2330fc44c 100644 --- a/yazi-core/src/manager/commands/tab_create.rs +++ b/yazi-core/src/manager/commands/tab_create.rs @@ -1,7 +1,7 @@ use yazi_boot::BOOT; use yazi_macro::render; use yazi_proxy::AppProxy; -use yazi_shared::{event::CmdCow, fs::Url}; +use yazi_shared::{event::CmdCow, url::Url}; use crate::{manager::Tabs, tab::Tab}; diff --git a/yazi-core/src/manager/commands/update_mimes.rs b/yazi-core/src/manager/commands/update_mimes.rs index 814a99b4c..c411dcf8c 100644 --- a/yazi-core/src/manager/commands/update_mimes.rs +++ b/yazi-core/src/manager/commands/update_mimes.rs @@ -2,7 +2,7 @@ use std::{borrow::Cow, collections::HashMap}; use tracing::error; use yazi_macro::render; -use yazi_shared::{event::CmdCow, fs::Url}; +use yazi_shared::{event::CmdCow, url::Url}; use crate::{manager::{LINKED, Manager}, tasks::Tasks}; diff --git a/yazi-core/src/manager/commands/update_paged.rs b/yazi-core/src/manager/commands/update_paged.rs index 59a0bc2b8..b679c9d6c 100644 --- a/yazi-core/src/manager/commands/update_paged.rs +++ b/yazi-core/src/manager/commands/update_paged.rs @@ -1,4 +1,4 @@ -use yazi_shared::{event::{CmdCow, Data}, fs::Url}; +use yazi_shared::{event::{CmdCow, Data}, url::Url}; use crate::{manager::Manager, tasks::Tasks}; diff --git a/yazi-core/src/manager/commands/update_tasks.rs b/yazi-core/src/manager/commands/update_tasks.rs index 785be0694..9bc485980 100644 --- a/yazi-core/src/manager/commands/update_tasks.rs +++ b/yazi-core/src/manager/commands/update_tasks.rs @@ -1,4 +1,4 @@ -use yazi_shared::{event::CmdCow, fs::Url}; +use yazi_shared::{event::CmdCow, url::Url}; use crate::manager::Manager; diff --git a/yazi-core/src/manager/commands/update_yanked.rs b/yazi-core/src/manager/commands/update_yanked.rs index b26a3bd5d..ca2fcde90 100644 --- a/yazi-core/src/manager/commands/update_yanked.rs +++ b/yazi-core/src/manager/commands/update_yanked.rs @@ -1,7 +1,7 @@ use std::collections::HashSet; use yazi_macro::render; -use yazi_shared::{event::CmdCow, fs::Url}; +use yazi_shared::{event::CmdCow, url::Url}; use crate::manager::{Manager, Yanked}; diff --git a/yazi-core/src/manager/linked.rs b/yazi-core/src/manager/linked.rs index c29fc2012..2de344d27 100644 --- a/yazi-core/src/manager/linked.rs +++ b/yazi-core/src/manager/linked.rs @@ -1,6 +1,6 @@ use std::{collections::HashMap, ops::{Deref, DerefMut}}; -use yazi_shared::fs::Url; +use yazi_shared::url::Url; #[derive(Default)] pub struct Linked(HashMap /* from ==> to */); diff --git a/yazi-core/src/manager/manager.rs b/yazi-core/src/manager/manager.rs index 34f01fa4e..4a1ff864a 100644 --- a/yazi-core/src/manager/manager.rs +++ b/yazi-core/src/manager/manager.rs @@ -2,7 +2,7 @@ use ratatui::layout::Rect; use yazi_adapter::Dimension; use yazi_config::popup::{Origin, Position}; use yazi_fs::Folder; -use yazi_shared::{Id, fs::{File, Url}}; +use yazi_shared::{Id, fs::File, url::Url}; use super::{Mimetype, Tabs, Watcher, Yanked}; use crate::tab::Tab; diff --git a/yazi-core/src/manager/mimetype.rs b/yazi-core/src/manager/mimetype.rs index 63e44a2e8..1b3392932 100644 --- a/yazi-core/src/manager/mimetype.rs +++ b/yazi-core/src/manager/mimetype.rs @@ -1,6 +1,6 @@ use std::{collections::HashMap, path::PathBuf}; -use yazi_shared::fs::{Url, UrlScheme}; +use yazi_shared::url::{Url, UrlScheme}; #[derive(Default)] pub struct Mimetype(HashMap); diff --git a/yazi-core/src/manager/tabs.rs b/yazi-core/src/manager/tabs.rs index 4ddcf99e4..c8e4ea6d9 100644 --- a/yazi-core/src/manager/tabs.rs +++ b/yazi-core/src/manager/tabs.rs @@ -3,7 +3,7 @@ use std::ops::{Deref, DerefMut}; use yazi_boot::BOOT; use yazi_dds::Pubsub; use yazi_proxy::ManagerProxy; -use yazi_shared::{Id, fs::Url}; +use yazi_shared::{Id, url::Url}; use crate::tab::Tab; diff --git a/yazi-core/src/manager/watcher.rs b/yazi-core/src/manager/watcher.rs index bc6935616..cf560c230 100644 --- a/yazi-core/src/manager/watcher.rs +++ b/yazi-core/src/manager/watcher.rs @@ -10,7 +10,7 @@ use yazi_config::PLUGIN; use yazi_fs::{Files, Folder}; use yazi_plugin::isolate; use yazi_proxy::WATCHER; -use yazi_shared::{RoCell, event::CmdCow, fs::{Cha, File, FilesOp, Url, realname_unchecked}}; +use yazi_shared::{RoCell, event::CmdCow, fs::{Cha, File, FilesOp, realname_unchecked}, url::Url}; use super::Linked; diff --git a/yazi-core/src/manager/yanked.rs b/yazi-core/src/manager/yanked.rs index ec53bdb70..ba0ca40e6 100644 --- a/yazi-core/src/manager/yanked.rs +++ b/yazi-core/src/manager/yanked.rs @@ -1,7 +1,7 @@ use std::{collections::HashSet, ops::Deref}; use yazi_dds::Pubsub; -use yazi_shared::fs::{FilesOp, Url}; +use yazi_shared::{fs::FilesOp, url::Url}; #[derive(Default)] pub struct Yanked { diff --git a/yazi-core/src/spot/spot.rs b/yazi-core/src/spot/spot.rs index b42af36d1..a9ff5b185 100644 --- a/yazi-core/src/spot/spot.rs +++ b/yazi-core/src/spot/spot.rs @@ -3,7 +3,7 @@ use std::borrow::Cow; use tokio_util::sync::CancellationToken; use yazi_config::PLUGIN; use yazi_plugin::{isolate, utils::SpotLock}; -use yazi_shared::fs::{File, Url}; +use yazi_shared::{fs::File, url::Url}; #[derive(Default)] pub struct Spot { diff --git a/yazi-core/src/tab/commands/cd.rs b/yazi-core/src/tab/commands/cd.rs index d734dd42e..7fffba567 100644 --- a/yazi-core/src/tab/commands/cd.rs +++ b/yazi-core/src/tab/commands/cd.rs @@ -6,7 +6,7 @@ use yazi_config::popup::InputCfg; use yazi_dds::Pubsub; use yazi_macro::render; use yazi_proxy::{CompletionProxy, InputProxy, ManagerProxy, TabProxy}; -use yazi_shared::{Debounce, errors::InputError, event::CmdCow, fs::{Url, expand_path}}; +use yazi_shared::{Debounce, errors::InputError, event::CmdCow, fs::expand_path, url::Url}; use crate::tab::Tab; diff --git a/yazi-core/src/tab/commands/reveal.rs b/yazi-core/src/tab/commands/reveal.rs index 8f4f9df8d..72cafc085 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::CmdCow, fs::{File, FilesOp, Url, expand_path}}; +use yazi_shared::{event::CmdCow, fs::{File, FilesOp, expand_path}, url::Url}; use crate::tab::Tab; diff --git a/yazi-core/src/tab/commands/toggle.rs b/yazi-core/src/tab/commands/toggle.rs index f8b8a2883..e0f6e8607 100644 --- a/yazi-core/src/tab/commands/toggle.rs +++ b/yazi-core/src/tab/commands/toggle.rs @@ -1,6 +1,6 @@ use yazi_macro::render_and; use yazi_proxy::AppProxy; -use yazi_shared::{event::CmdCow, fs::Url}; +use yazi_shared::{event::CmdCow, url::Url}; use crate::tab::Tab; diff --git a/yazi-core/src/tab/finder.rs b/yazi-core/src/tab/finder.rs index 147485802..8f0e02f32 100644 --- a/yazi-core/src/tab/finder.rs +++ b/yazi-core/src/tab/finder.rs @@ -2,7 +2,7 @@ use std::collections::HashMap; use anyhow::Result; use yazi_fs::{Files, Filter, FilterCase}; -use yazi_shared::fs::Url; +use yazi_shared::url::Url; pub struct Finder { pub filter: Filter, diff --git a/yazi-core/src/tab/history.rs b/yazi-core/src/tab/history.rs index 39fba485c..dc1da67c0 100644 --- a/yazi-core/src/tab/history.rs +++ b/yazi-core/src/tab/history.rs @@ -1,7 +1,7 @@ use std::{collections::HashMap, ops::{Deref, DerefMut}}; use yazi_fs::Folder; -use yazi_shared::fs::Url; +use yazi_shared::url::Url; #[derive(Default)] pub struct History(HashMap); diff --git a/yazi-core/src/tab/preview.rs b/yazi-core/src/tab/preview.rs index 35bd3ae1a..3196db664 100644 --- a/yazi-core/src/tab/preview.rs +++ b/yazi-core/src/tab/preview.rs @@ -8,7 +8,7 @@ use yazi_config::PLUGIN; use yazi_fs::Files; use yazi_macro::render; use yazi_plugin::{external::Highlighter, isolate, utils::PreviewLock}; -use yazi_shared::{MIME_DIR, fs::{Cha, File, FilesOp, Url}}; +use yazi_shared::{MIME_DIR, fs::{Cha, File, FilesOp}, url::Url}; #[derive(Default)] pub struct Preview { diff --git a/yazi-core/src/tab/selected.rs b/yazi-core/src/tab/selected.rs index 73c51b67d..2b17abf8a 100644 --- a/yazi-core/src/tab/selected.rs +++ b/yazi-core/src/tab/selected.rs @@ -1,6 +1,6 @@ use std::{collections::HashMap, ops::Deref}; -use yazi_shared::{fs::{FilesOp, Url}, timestamp_us}; +use yazi_shared::{fs::FilesOp, timestamp_us, url::Url}; #[derive(Default)] pub struct Selected { diff --git a/yazi-core/src/tab/tab.rs b/yazi-core/src/tab/tab.rs index e6e3aa2d2..0da032399 100644 --- a/yazi-core/src/tab/tab.rs +++ b/yazi-core/src/tab/tab.rs @@ -7,7 +7,7 @@ use yazi_adapter::Dimension; use yazi_config::{LAYOUT, popup::{Origin, Position}}; use yazi_fs::{Folder, FolderStage}; use yazi_macro::render; -use yazi_shared::{Id, Ids, fs::{File, Url}}; +use yazi_shared::{Id, Ids, fs::File, url::Url}; use super::{Backstack, Finder, History, Mode, Preference, Preview}; use crate::{spot::Spot, tab::Selected}; diff --git a/yazi-core/src/tasks/file.rs b/yazi-core/src/tasks/file.rs index c09068d5d..65bff6410 100644 --- a/yazi-core/src/tasks/file.rs +++ b/yazi-core/src/tasks/file.rs @@ -1,7 +1,7 @@ use std::collections::HashSet; use tracing::debug; -use yazi_shared::fs::Url; +use yazi_shared::url::Url; use super::Tasks; diff --git a/yazi-core/src/tasks/process.rs b/yazi-core/src/tasks/process.rs index d71164888..977db8373 100644 --- a/yazi-core/src/tasks/process.rs +++ b/yazi-core/src/tasks/process.rs @@ -1,7 +1,7 @@ use std::{borrow::Cow, collections::HashMap, ffi::OsString, mem}; use yazi_config::{OPEN, open::Opener}; -use yazi_shared::fs::Url; +use yazi_shared::url::Url; use super::Tasks; diff --git a/yazi-dds/src/body/bulk.rs b/yazi-dds/src/body/bulk.rs index 3f17fb14c..96bf49220 100644 --- a/yazi-dds/src/body/bulk.rs +++ b/yazi-dds/src/body/bulk.rs @@ -2,7 +2,7 @@ use std::{borrow::Cow, collections::{HashMap, hash_map}}; use mlua::{AnyUserData, IntoLua, IntoLuaMulti, Lua, MetaMethod, UserData, UserDataRefMut, Value}; use serde::{Deserialize, Serialize}; -use yazi_shared::fs::Url; +use yazi_shared::url::Url; use super::Body; diff --git a/yazi-dds/src/body/cd.rs b/yazi-dds/src/body/cd.rs index f0bc9095e..05d117cb5 100644 --- a/yazi-dds/src/body/cd.rs +++ b/yazi-dds/src/body/cd.rs @@ -2,7 +2,7 @@ use std::borrow::Cow; use mlua::{IntoLua, Lua, Value}; use serde::{Deserialize, Serialize}; -use yazi_shared::{Id, fs::Url}; +use yazi_shared::{Id, url::Url}; use super::Body; diff --git a/yazi-dds/src/body/delete.rs b/yazi-dds/src/body/delete.rs index 002ffe47e..6bedd0cd1 100644 --- a/yazi-dds/src/body/delete.rs +++ b/yazi-dds/src/body/delete.rs @@ -2,7 +2,7 @@ use std::borrow::Cow; use mlua::{IntoLua, Lua, Value}; use serde::{Deserialize, Serialize}; -use yazi_shared::fs::Url; +use yazi_shared::url::Url; use super::Body; diff --git a/yazi-dds/src/body/hover.rs b/yazi-dds/src/body/hover.rs index 3ec674350..395d601c4 100644 --- a/yazi-dds/src/body/hover.rs +++ b/yazi-dds/src/body/hover.rs @@ -2,7 +2,7 @@ use std::borrow::Cow; use mlua::{IntoLua, Lua, Value}; use serde::{Deserialize, Serialize}; -use yazi_shared::{Id, fs::Url}; +use yazi_shared::{Id, url::Url}; use super::Body; diff --git a/yazi-dds/src/body/move_.rs b/yazi-dds/src/body/move_.rs index 5721f058a..b9025bd59 100644 --- a/yazi-dds/src/body/move_.rs +++ b/yazi-dds/src/body/move_.rs @@ -2,7 +2,7 @@ use std::borrow::Cow; use mlua::{IntoLua, Lua, Value}; use serde::{Deserialize, Serialize}; -use yazi_shared::fs::Url; +use yazi_shared::url::Url; use super::Body; diff --git a/yazi-dds/src/body/rename.rs b/yazi-dds/src/body/rename.rs index c19c7f3a4..e20a6276e 100644 --- a/yazi-dds/src/body/rename.rs +++ b/yazi-dds/src/body/rename.rs @@ -2,7 +2,7 @@ use std::borrow::Cow; use mlua::{IntoLua, Lua, Value}; use serde::{Deserialize, Serialize}; -use yazi_shared::fs::Url; +use yazi_shared::url::Url; use super::Body; diff --git a/yazi-dds/src/body/trash.rs b/yazi-dds/src/body/trash.rs index 02e1cea51..022f3a9b3 100644 --- a/yazi-dds/src/body/trash.rs +++ b/yazi-dds/src/body/trash.rs @@ -2,7 +2,7 @@ use std::borrow::Cow; use mlua::{IntoLua, Lua, Value}; use serde::{Deserialize, Serialize}; -use yazi_shared::fs::Url; +use yazi_shared::url::Url; use super::Body; diff --git a/yazi-dds/src/body/yank.rs b/yazi-dds/src/body/yank.rs index 64ba3df14..31c71756d 100644 --- a/yazi-dds/src/body/yank.rs +++ b/yazi-dds/src/body/yank.rs @@ -2,7 +2,7 @@ use std::{borrow::Cow, collections::HashSet}; use mlua::{IntoLua, Lua, MetaMethod, UserData, Value}; use serde::{Deserialize, Serialize}; -use yazi_shared::fs::Url; +use yazi_shared::url::Url; use super::Body; diff --git a/yazi-dds/src/pubsub.rs b/yazi-dds/src/pubsub.rs index 807294e54..0db796650 100644 --- a/yazi-dds/src/pubsub.rs +++ b/yazi-dds/src/pubsub.rs @@ -3,7 +3,7 @@ use std::collections::{HashMap, HashSet}; use mlua::Function; use parking_lot::RwLock; use yazi_boot::BOOT; -use yazi_shared::{Id, RoCell, fs::Url}; +use yazi_shared::{Id, RoCell, url::Url}; use crate::{Client, ID, PEERS, body::{Body, BodyBulk, BodyCd, BodyDelete, BodyHi, BodyHover, BodyMove, BodyMoveItem, BodyRename, BodyTab, BodyTrash, BodyYank}}; diff --git a/yazi-dds/src/pump.rs b/yazi-dds/src/pump.rs index 652cdaf81..335ae521d 100644 --- a/yazi-dds/src/pump.rs +++ b/yazi-dds/src/pump.rs @@ -4,7 +4,7 @@ use parking_lot::Mutex; use tokio::{pin, select, sync::mpsc}; use tokio_stream::{StreamExt, wrappers::UnboundedReceiverStream}; use tokio_util::sync::CancellationToken; -use yazi_shared::{RoCell, fs::Url}; +use yazi_shared::{RoCell, url::Url}; use crate::{Pubsub, body::BodyMoveItem}; diff --git a/yazi-dds/src/sendable.rs b/yazi-dds/src/sendable.rs index 425633795..e19484979 100644 --- a/yazi-dds/src/sendable.rs +++ b/yazi-dds/src/sendable.rs @@ -35,7 +35,7 @@ impl Sendable { Value::Function(_) => Err("function is not supported".into_lua_err())?, Value::Thread(_) => Err("thread is not supported".into_lua_err())?, Value::UserData(ud) => { - if let Ok(t) = ud.take::() { + if let Ok(t) = ud.take::() { Data::Url(t) } else if let Ok(t) = ud.take::() { Data::Any(Box::new(t)) @@ -188,7 +188,7 @@ impl Sendable { Value::Function(_) => Err("function is not supported".into_lua_err())?, Value::Thread(_) => Err("thread is not supported".into_lua_err())?, Value::UserData(ud) => { - if let Ok(t) = ud.take::() { + if let Ok(t) = ud.take::() { DataKey::Url(t) } else { Err("unsupported userdata included".into_lua_err())? diff --git a/yazi-fm/Cargo.toml b/yazi-fm/Cargo.toml index 9b225ab16..ff25bc994 100644 --- a/yazi-fm/Cargo.toml +++ b/yazi-fm/Cargo.toml @@ -41,7 +41,7 @@ tokio-stream = { workspace = true } # Logging tracing = { workspace = true } tracing-appender = "0.2.3" -tracing-subscriber = { version = "0.3.18", features = [ "env-filter" ] } +tracing-subscriber = { version = "0.3.19", features = [ "env-filter" ] } [target."cfg(unix)".dependencies] libc = { workspace = true } diff --git a/yazi-fm/src/lives/selected.rs b/yazi-fm/src/lives/selected.rs index d2de2a38c..d19984108 100644 --- a/yazi-fm/src/lives/selected.rs +++ b/yazi-fm/src/lives/selected.rs @@ -7,23 +7,23 @@ use super::{Iter, Lives}; #[derive(Clone, Copy)] pub(super) struct Selected { - inner: *const HashMap, + inner: *const HashMap, } impl Deref for Selected { - type Target = HashMap; + type Target = HashMap; fn deref(&self) -> &Self::Target { self.inner() } } impl Selected { #[inline] - pub(super) fn make(inner: &HashMap) -> mlua::Result { + pub(super) fn make(inner: &HashMap) -> mlua::Result { Lives::scoped_userdata(Self { inner }) } #[inline] - fn inner(&self) -> &'static HashMap { unsafe { &*self.inner } } + fn inner(&self) -> &'static HashMap { unsafe { &*self.inner } } } impl UserData for Selected { @@ -32,7 +32,7 @@ impl UserData for Selected { methods.add_meta_method(MetaMethod::Pairs, |lua, me, ()| { let iter = lua.create_function( - |lua, mut iter: UserDataRefMut, _>>| { + |lua, mut iter: UserDataRefMut, _>>| { if let Some(next) = iter.next() { (next.0, Url::cast(lua, next.1.clone())?).into_lua_multi(lua) } else { diff --git a/yazi-fm/src/lives/yanked.rs b/yazi-fm/src/lives/yanked.rs index 0ca5262ec..e0316dc43 100644 --- a/yazi-fm/src/lives/yanked.rs +++ b/yazi-fm/src/lives/yanked.rs @@ -35,7 +35,7 @@ impl UserData for Yanked { methods.add_meta_method(MetaMethod::Pairs, |lua, me, ()| { let iter = lua.create_function( - |lua, mut iter: UserDataRefMut, _>>| { + |lua, mut iter: UserDataRefMut, _>>| { if let Some(next) = iter.next() { (next.0, Url::cast(lua, next.1.clone())?).into_lua_multi(lua) } else { diff --git a/yazi-fs/src/files.rs b/yazi-fs/src/files.rs index 482e57505..e2d70f4de 100644 --- a/yazi-fs/src/files.rs +++ b/yazi-fs/src/files.rs @@ -2,7 +2,7 @@ use std::{collections::{HashMap, HashSet}, mem, ops::Deref}; use tokio::{fs::{self, DirEntry}, select, sync::mpsc::{self, UnboundedReceiver}}; use yazi_config::{MANAGER, manager::SortBy}; -use yazi_shared::{Id, fs::{Cha, FILES_TICKET, File, FilesOp, Url, Urn, UrnBuf, maybe_exists}}; +use yazi_shared::{Id, fs::{Cha, FILES_TICKET, File, FilesOp, maybe_exists}, url::{Url, Urn, UrnBuf}}; use super::{FilesSorter, Filter}; diff --git a/yazi-fs/src/folder.rs b/yazi-fs/src/folder.rs index 11e7205ee..3d8016b3a 100644 --- a/yazi-fs/src/folder.rs +++ b/yazi-fs/src/folder.rs @@ -2,7 +2,7 @@ use std::mem; use yazi_config::{LAYOUT, MANAGER}; use yazi_proxy::ManagerProxy; -use yazi_shared::fs::{Cha, File, FilesOp, Url, Urn}; +use yazi_shared::{fs::{Cha, File, FilesOp}, url::{Url, Urn}}; use super::FolderStage; use crate::{Files, Step}; diff --git a/yazi-fs/src/sorter.rs b/yazi-fs/src/sorter.rs index 86315bcd5..92d547d50 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::{LcgRng, fs::{File, UrnBuf}, natsort, translit::Transliterator}; +use yazi_shared::{LcgRng, fs::File, natsort, translit::Transliterator, url::UrnBuf}; #[derive(Clone, Copy, Default, PartialEq)] pub struct FilesSorter { diff --git a/yazi-plugin/src/external/fd.rs b/yazi-plugin/src/external/fd.rs index 61480e9a3..b1fbac41b 100644 --- a/yazi-plugin/src/external/fd.rs +++ b/yazi-plugin/src/external/fd.rs @@ -2,7 +2,7 @@ use std::process::Stdio; use anyhow::Result; use tokio::{io::{AsyncBufReadExt, BufReader}, process::{Child, Command}, sync::mpsc::{self, UnboundedReceiver}}; -use yazi_shared::fs::{File, Url}; +use yazi_shared::{fs::File, url::Url}; pub struct FdOpt { pub cwd: Url, diff --git a/yazi-plugin/src/external/rg.rs b/yazi-plugin/src/external/rg.rs index 7ff71f2c5..85d645a07 100644 --- a/yazi-plugin/src/external/rg.rs +++ b/yazi-plugin/src/external/rg.rs @@ -2,7 +2,7 @@ use std::process::Stdio; use anyhow::Result; use tokio::{io::{AsyncBufReadExt, BufReader}, process::Command, sync::mpsc::{self, UnboundedReceiver}}; -use yazi_shared::fs::{File, Url}; +use yazi_shared::{fs::File, url::Url}; pub struct RgOpt { pub cwd: Url, diff --git a/yazi-plugin/src/fs/fs.rs b/yazi-plugin/src/fs/fs.rs index 33c9813bf..444868093 100644 --- a/yazi-plugin/src/fs/fs.rs +++ b/yazi-plugin/src/fs/fs.rs @@ -104,7 +104,7 @@ fn read_dir(lua: &Lua) -> mlua::Result { continue; } - let url = yazi_shared::fs::Url::from(path); + let url = yazi_shared::url::Url::from(path); let file = if !resolve { yazi_shared::fs::File::from_dummy(url, next.file_type().await.ok()) } else if let Ok(meta) = next.metadata().await { diff --git a/yazi-plugin/src/url/url.rs b/yazi-plugin/src/url/url.rs index af0bbdadd..508e4fbdc 100644 --- a/yazi-plugin/src/url/url.rs +++ b/yazi-plugin/src/url/url.rs @@ -2,13 +2,13 @@ use mlua::{AnyUserData, ExternalError, Lua, MetaMethod, UserDataFields, UserData use crate::bindings::Cast; -pub type UrlRef = UserDataRef; +pub type UrlRef = UserDataRef; pub struct Url; impl Url { pub fn register(lua: &Lua) -> mlua::Result<()> { - lua.register_userdata_type::(|reg| { + lua.register_userdata_type::(|reg| { reg.add_method("frag", |lua, me, ()| lua.create_string(me.frag())); reg.add_field_method_get("is_regular", |_, me| Ok(me.is_regular())); reg.add_field_method_get("is_search", |_, me| Ok(me.is_search())); @@ -28,7 +28,7 @@ impl Url { reg.add_method("join", |lua, me, other: Value| { Self::cast(lua, match other { Value::String(s) => me.join(s.to_str()?.as_ref()), - Value::UserData(ud) => me.join(&*ud.borrow::()?), + Value::UserData(ud) => me.join(&*ud.borrow::()?), _ => Err("must be a string or a Url".into_lua_err())?, }) }); @@ -38,24 +38,24 @@ impl Url { reg.add_method("starts_with", |_, me, base: Value| { Ok(match base { Value::String(s) => me.starts_with(s.to_str()?.as_ref()), - Value::UserData(ud) => me.starts_with(&*ud.borrow::()?), + Value::UserData(ud) => me.starts_with(&*ud.borrow::()?), _ => Err("must be a string or a Url".into_lua_err())?, }) }); reg.add_method("ends_with", |_, me, child: Value| { Ok(match child { Value::String(s) => me.ends_with(s.to_str()?.as_ref()), - Value::UserData(ud) => me.ends_with(&*ud.borrow::()?), + Value::UserData(ud) => me.ends_with(&*ud.borrow::()?), _ => Err("must be a string or a Url".into_lua_err())?, }) }); reg.add_method("strip_prefix", |lua, me, base: Value| { let path = match base { Value::String(s) => me.strip_prefix(s.to_str()?.as_ref()), - Value::UserData(ud) => me.strip_prefix(&*ud.borrow::()?), + Value::UserData(ud) => me.strip_prefix(&*ud.borrow::()?), _ => Err("must be a string or a Url".into_lua_err())?, }; - path.ok().map(|p| Self::cast(lua, yazi_shared::fs::Url::from(p))).transpose() + path.ok().map(|p| Self::cast(lua, yazi_shared::url::Url::from(p))).transpose() }); reg.add_meta_method(MetaMethod::Eq, |_, me, other: UrlRef| Ok(me == &*other)); @@ -72,12 +72,12 @@ impl Url { lua.globals().raw_set( "Url", lua.create_function(|lua, url: mlua::String| { - Self::cast(lua, yazi_shared::fs::Url::from(url.to_str()?.as_ref())) + Self::cast(lua, yazi_shared::url::Url::from(url.to_str()?.as_ref())) })?, ) } } -impl> Cast for Url { +impl> Cast for Url { fn cast(lua: &Lua, data: T) -> mlua::Result { lua.create_any_userdata(data.into()) } } diff --git a/yazi-plugin/src/utils/preview.rs b/yazi-plugin/src/utils/preview.rs index 382ade427..36c0e9a1c 100644 --- a/yazi-plugin/src/utils/preview.rs +++ b/yazi-plugin/src/utils/preview.rs @@ -7,7 +7,7 @@ use super::Utils; use crate::{elements::{Area, Rect, Renderable, Text, WRAP, WRAP_NO}, external::Highlighter, file::FileRef}; pub struct PreviewLock { - pub url: yazi_shared::fs::Url, + pub url: yazi_shared::url::Url, pub cha: yazi_shared::fs::Cha, pub mime: String, diff --git a/yazi-plugin/src/utils/spot.rs b/yazi-plugin/src/utils/spot.rs index 40b0fafa7..39382f558 100644 --- a/yazi-plugin/src/utils/spot.rs +++ b/yazi-plugin/src/utils/spot.rs @@ -7,7 +7,7 @@ use super::Utils; use crate::{elements::Renderable, file::FileRef}; pub struct SpotLock { - pub url: yazi_shared::fs::Url, + pub url: yazi_shared::url::Url, pub cha: yazi_shared::fs::Cha, pub mime: String, diff --git a/yazi-proxy/src/manager.rs b/yazi-proxy/src/manager.rs index c5e1aad5f..0a654e556 100644 --- a/yazi-proxy/src/manager.rs +++ b/yazi-proxy/src/manager.rs @@ -1,5 +1,5 @@ use yazi_macro::emit; -use yazi_shared::{Id, Layer, event::Cmd, fs::Url}; +use yazi_shared::{Id, Layer, event::Cmd, url::Url}; use crate::options::OpenDoOpt; diff --git a/yazi-proxy/src/options/open.rs b/yazi-proxy/src/options/open.rs index 48a7c60a4..0882ff4b3 100644 --- a/yazi-proxy/src/options/open.rs +++ b/yazi-proxy/src/options/open.rs @@ -1,7 +1,7 @@ use std::borrow::Cow; use yazi_config::open::Opener; -use yazi_shared::{event::CmdCow, fs::Url}; +use yazi_shared::{event::CmdCow, url::Url}; // --- Open #[derive(Default)] diff --git a/yazi-proxy/src/tab.rs b/yazi-proxy/src/tab.rs index b47b05cec..210ed6634 100644 --- a/yazi-proxy/src/tab.rs +++ b/yazi-proxy/src/tab.rs @@ -1,5 +1,5 @@ use yazi_macro::emit; -use yazi_shared::{Layer, event::Cmd, fs::Url}; +use yazi_shared::{Layer, event::Cmd, url::Url}; use crate::options::SearchOpt; diff --git a/yazi-proxy/src/tasks.rs b/yazi-proxy/src/tasks.rs index 428a82c09..44dc76fea 100644 --- a/yazi-proxy/src/tasks.rs +++ b/yazi-proxy/src/tasks.rs @@ -3,7 +3,7 @@ use std::{borrow::Cow, ffi::OsString}; use tokio::sync::oneshot; use yazi_config::open::Opener; use yazi_macro::emit; -use yazi_shared::{Layer, event::Cmd, fs::Url}; +use yazi_shared::{Layer, event::Cmd, url::Url}; use crate::options::{OpenWithOpt, ProcessExecOpt}; diff --git a/yazi-scheduler/src/file/file.rs b/yazi-scheduler/src/file/file.rs index e46cdae5b..4f711a9d7 100644 --- a/yazi-scheduler/src/file/file.rs +++ b/yazi-scheduler/src/file/file.rs @@ -4,7 +4,7 @@ use anyhow::{Result, anyhow}; use tokio::{fs::{self, DirEntry}, io::{self, ErrorKind::{AlreadyExists, NotFound}}, sync::mpsc}; use tracing::warn; use yazi_config::TASKS; -use yazi_shared::fs::{Cha, Url, calculate_size, copy_with_progress, maybe_exists, ok_or_not_found, path_relative_to}; +use yazi_shared::{fs::{Cha, calculate_size, copy_with_progress, maybe_exists, ok_or_not_found, path_relative_to}, url::Url}; use super::{FileOp, FileOpDelete, FileOpHardlink, FileOpLink, FileOpPaste, FileOpTrash}; use crate::{LOW, NORMAL, TaskOp, TaskProg}; diff --git a/yazi-scheduler/src/file/op.rs b/yazi-scheduler/src/file/op.rs index b88019d7a..b018e6082 100644 --- a/yazi-scheduler/src/file/op.rs +++ b/yazi-scheduler/src/file/op.rs @@ -1,4 +1,4 @@ -use yazi_shared::fs::{Cha, Url}; +use yazi_shared::{fs::Cha, url::Url}; #[derive(Debug)] pub enum FileOp { diff --git a/yazi-scheduler/src/prework/op.rs b/yazi-scheduler/src/prework/op.rs index 3532dd6a2..ae9a28b8f 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::{Fetcher, Preloader}; -use yazi_shared::{Throttle, fs::Url}; +use yazi_shared::{Throttle, url::Url}; #[derive(Debug)] pub enum PreworkOp { diff --git a/yazi-scheduler/src/prework/prework.rs b/yazi-scheduler/src/prework/prework.rs index 5bb75c2ae..09c91c7c8 100644 --- a/yazi-scheduler/src/prework/prework.rs +++ b/yazi-scheduler/src/prework/prework.rs @@ -6,7 +6,7 @@ use tokio::sync::mpsc; use tracing::error; use yazi_config::Priority; use yazi_plugin::isolate; -use yazi_shared::{event::CmdCow, fs::{FilesOp, Url, calculate_size}}; +use yazi_shared::{event::CmdCow, fs::{FilesOp, calculate_size}, url::Url}; use super::{PreworkOp, PreworkOpFetch, PreworkOpLoad, PreworkOpSize}; use crate::{HIGH, NORMAL, TaskOp, TaskProg}; diff --git a/yazi-scheduler/src/scheduler.rs b/yazi-scheduler/src/scheduler.rs index 6299c6034..193f8c67d 100644 --- a/yazi-scheduler/src/scheduler.rs +++ b/yazi-scheduler/src/scheduler.rs @@ -7,7 +7,7 @@ use tokio::{fs, select, sync::{mpsc::{self, UnboundedReceiver}, oneshot}, task:: use yazi_config::{TASKS, open::Opener, plugin::{Fetcher, Preloader}}; use yazi_dds::Pump; use yazi_proxy::{ManagerProxy, options::PluginOpt}; -use yazi_shared::{Throttle, fs::{Url, must_be_dir, remove_dir_clean, unique_name}}; +use yazi_shared::{Throttle, fs::{must_be_dir, remove_dir_clean, unique_name}, url::Url}; use super::{Ongoing, TaskProg, TaskStage}; 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}}; diff --git a/yazi-shared/src/event/cmd.rs b/yazi-shared/src/event/cmd.rs index 7b8234172..2ece19173 100644 --- a/yazi-shared/src/event/cmd.rs +++ b/yazi-shared/src/event/cmd.rs @@ -4,7 +4,7 @@ use anyhow::{Result, bail}; use serde::{Deserialize, de}; use super::{Data, DataKey}; -use crate::fs::Url; +use crate::url::Url; #[derive(Debug, Default)] pub struct Cmd { diff --git a/yazi-shared/src/event/cow.rs b/yazi-shared/src/event/cow.rs index 916eaf406..6f6e710ce 100644 --- a/yazi-shared/src/event/cow.rs +++ b/yazi-shared/src/event/cow.rs @@ -1,7 +1,7 @@ use std::{borrow::Cow, ops::Deref}; use super::{Cmd, Data, DataKey}; -use crate::fs::Url; +use crate::url::Url; #[derive(Debug)] pub enum CmdCow { diff --git a/yazi-shared/src/event/data.rs b/yazi-shared/src/event/data.rs index fc938aab1..d2e3ff2bb 100644 --- a/yazi-shared/src/event/data.rs +++ b/yazi-shared/src/event/data.rs @@ -2,7 +2,7 @@ use std::{any::Any, borrow::Cow, collections::HashMap}; use serde::{Deserialize, Serialize, de}; -use crate::{OrderedFloat, fs::Url}; +use crate::{OrderedFloat, url::Url}; // --- Data #[derive(Debug, Serialize, Deserialize)] diff --git a/yazi-shared/src/fs/cha.rs b/yazi-shared/src/fs/cha.rs index 8f9597fb9..f91b3473d 100644 --- a/yazi-shared/src/fs/cha.rs +++ b/yazi-shared/src/fs/cha.rs @@ -147,7 +147,7 @@ impl Cha { let mut attached = ChaKind::empty(); #[cfg(unix)] - if super::Urn::new(path).is_hidden() { + if crate::url::Urn::new(path).is_hidden() { attached |= ChaKind::HIDDEN; } #[cfg(windows)] diff --git a/yazi-shared/src/fs/file.rs b/yazi-shared/src/fs/file.rs index 7e90809f9..9cb26525d 100644 --- a/yazi-shared/src/fs/file.rs +++ b/yazi-shared/src/fs/file.rs @@ -3,8 +3,7 @@ use std::{ffi::OsStr, fs::{FileType, Metadata}, ops::Deref}; use anyhow::Result; use tokio::fs; -use super::{Urn, UrnBuf}; -use crate::{SyncCell, fs::{Cha, Url}, theme::IconCache}; +use crate::{SyncCell, fs::Cha, theme::IconCache, url::{Url, Urn, UrnBuf}}; #[derive(Clone, Debug, Default)] pub struct File { diff --git a/yazi-shared/src/fs/loc.rs b/yazi-shared/src/fs/loc.rs index 332c48d58..c94193c67 100644 --- a/yazi-shared/src/fs/loc.rs +++ b/yazi-shared/src/fs/loc.rs @@ -1,6 +1,6 @@ use std::{cmp, ffi::{OsStr, OsString}, fmt::{self, Debug, Formatter}, hash::{Hash, Hasher}, ops::Deref, path::{Path, PathBuf}}; -use super::{Urn, UrnBuf}; +use crate::url::{Urn, UrnBuf}; #[derive(Clone, Default)] pub struct Loc { diff --git a/yazi-shared/src/fs/mod.rs b/yazi-shared/src/fs/mod.rs index c8b18d8d3..4650395ec 100644 --- a/yazi-shared/src/fs/mod.rs +++ b/yazi-shared/src/fs/mod.rs @@ -1 +1 @@ -yazi_macro::mod_flat!(cha file fns loc op path url urn); +yazi_macro::mod_flat!(cha file fns loc op path); diff --git a/yazi-shared/src/fs/op.rs b/yazi-shared/src/fs/op.rs index 84d03cce6..aed3293bf 100644 --- a/yazi-shared/src/fs/op.rs +++ b/yazi-shared/src/fs/op.rs @@ -1,7 +1,7 @@ use std::collections::{HashMap, HashSet}; -use super::{Cha, File, UrnBuf}; -use crate::{Id, Ids, Layer, event::Cmd, fs::Url}; +use super::{Cha, File}; +use crate::{Id, Ids, Layer, event::Cmd, url::{Url, UrnBuf}}; pub static FILES_TICKET: Ids = Ids::new(); diff --git a/yazi-shared/src/fs/path.rs b/yazi-shared/src/fs/path.rs index a9681b5bc..1acb1640c 100644 --- a/yazi-shared/src/fs/path.rs +++ b/yazi-shared/src/fs/path.rs @@ -3,7 +3,7 @@ use std::{borrow::Cow, env, ffi::OsString, future::Future, io, path::{Component, use tokio::fs; use super::Loc; -use crate::fs::Url; +use crate::url::Url; pub fn current_cwd() -> Option { env::var_os("PWD") diff --git a/yazi-shared/src/lib.rs b/yazi-shared/src/lib.rs index 24bb6f8d5..be828a44f 100644 --- a/yazi-shared/src/lib.rs +++ b/yazi-shared/src/lib.rs @@ -1,6 +1,6 @@ #![allow(clippy::option_map_unit_fn)] -yazi_macro::mod_pub!(errors event fs shell theme translit); +yazi_macro::mod_pub!(errors event fs shell theme translit url); yazi_macro::mod_flat!(chars condition debounce either env id layer natsort number os rand ro_cell sync_cell terminal throttle time xdg); diff --git a/yazi-shared/src/url/mod.rs b/yazi-shared/src/url/mod.rs new file mode 100644 index 000000000..f53f05331 --- /dev/null +++ b/yazi-shared/src/url/mod.rs @@ -0,0 +1 @@ +yazi_macro::mod_flat!(url urn); diff --git a/yazi-shared/src/fs/url.rs b/yazi-shared/src/url/url.rs similarity index 99% rename from yazi-shared/src/fs/url.rs rename to yazi-shared/src/url/url.rs index 28114467a..40c581ebc 100644 --- a/yazi-shared/src/fs/url.rs +++ b/yazi-shared/src/url/url.rs @@ -3,7 +3,8 @@ use std::{ffi::OsStr, fmt::{Debug, Display, Formatter}, ops::Deref, path::{Path, use percent_encoding::{AsciiSet, CONTROLS, percent_decode_str, percent_encode}; use serde::{Deserialize, Serialize}; -use super::{Loc, UrnBuf}; +use super::UrnBuf; +use crate::fs::Loc; const ENCODE_SET: &AsciiSet = &CONTROLS.add(b'#'); diff --git a/yazi-shared/src/fs/urn.rs b/yazi-shared/src/url/urn.rs similarity index 100% rename from yazi-shared/src/fs/urn.rs rename to yazi-shared/src/url/urn.rs