diff --git a/Cargo.lock b/Cargo.lock index f86f00f..f05ca48 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -18,6 +18,15 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "366ffbaa4442f4684d91e2cd7c5ea7c4ed8add41959a31447066e279e432b618" +[[package]] +name = "addr2line" +version = "0.25.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b5d307320b3181d6d7954e663bd7c774a838b8220fe0593c86d9fb09f498b4b" +dependencies = [ + "gimli", +] + [[package]] name = "adler2" version = "2.0.1" @@ -43,6 +52,15 @@ dependencies = [ "zerocopy", ] +[[package]] +name = "aho-corasick" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" +dependencies = [ + "memchr", +] + [[package]] name = "aligned" version = "0.4.3" @@ -61,6 +79,12 @@ dependencies = [ "equator", ] +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + [[package]] name = "android-activity" version = "0.6.0" @@ -106,6 +130,25 @@ dependencies = [ "libc", ] +[[package]] +name = "ansi-to-tui" +version = "8.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e42366bb9d958f042bf58f0a85e1b2d091997c1257ca49bddd7e4827aadc65fd" +dependencies = [ + "nom 8.0.0", + "ratatui-core", + "simdutf8", + "smallvec", + "thiserror 2.0.18", +] + +[[package]] +name = "anstyle" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5192cca8006f1fd4f7237516f40fa183bb07f8fbdfedaa0036de5ea9b0b45e78" + [[package]] name = "anyhow" version = "1.0.100" @@ -185,6 +228,12 @@ dependencies = [ "libloading 0.8.9", ] +[[package]] +name = "assert_enum_variants" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1685feee7d06d8813fe963f814c5c398d90392b9c3c41e656ac3100d5c334536" + [[package]] name = "async-broadcast" version = "0.7.2" @@ -339,6 +388,15 @@ dependencies = [ "system-deps", ] +[[package]] +name = "atomic" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a89cbf775b137e9b968e67227ef7f775587cde3fd31b0d8599dbd0f598a48340" +dependencies = [ + "bytemuck", +] + [[package]] name = "atomic-waker" version = "1.1.2" @@ -380,7 +438,7 @@ dependencies = [ "anyhow", "arrayvec", "log", - "nom", + "nom 8.0.0", "num-rational", "v_frame", ] @@ -394,15 +452,57 @@ dependencies = [ "arrayvec", ] +[[package]] +name = "backtrace" +version = "0.3.76" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb531853791a215d7c62a30daf0dde835f381ab5de4589cfe7c649d2cbe92bd6" +dependencies = [ + "addr2line", + "cfg-if", + "libc", + "miniz_oxide 0.8.9", + "object", + "rustc-demangle", + "windows-link", +] + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "beef" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a8241f3ebb85c056b509d4327ad0358fbbba6ffb340bf388f26350aeda225b1" + +[[package]] +name = "bit-set" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" +dependencies = [ + "bit-vec 0.6.3", +] + [[package]] name = "bit-set" version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" dependencies = [ - "bit-vec", + "bit-vec 0.8.0", ] +[[package]] +name = "bit-vec" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" + [[package]] name = "bit-vec" version = "0.8.0" @@ -445,6 +545,15 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + [[package]] name = "block2" version = "0.5.1" @@ -476,6 +585,17 @@ dependencies = [ "piper", ] +[[package]] +name = "bstr" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63044e1ae8e69f3b5a92c736ca6269b8d12fa7efe39bf34ddb06d102cf0e2cab" +dependencies = [ + "memchr", + "regex-automata", + "serde", +] + [[package]] name = "built" version = "0.8.0" @@ -602,6 +722,15 @@ dependencies = [ "wayland-client", ] +[[package]] +name = "castaway" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dec551ab6e7578819132c713a93c022a05d60159dc86e7a7050223577484c55a" +dependencies = [ + "rustversion", +] + [[package]] name = "cc" version = "1.2.54" @@ -642,6 +771,50 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" +[[package]] +name = "clap" +version = "4.5.54" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6e6ff9dcd79cff5cd969a17a545d79e84ab086e444102a591e288a8aa3ce394" +dependencies = [ + "clap_builder", +] + +[[package]] +name = "clap_builder" +version = "4.5.54" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa42cf4d2b7a41bc8f663a7cab4031ebafa1bf3875705bfaf8466dc60ab52c00" +dependencies = [ + "anstyle", + "clap_lex", +] + +[[package]] +name = "clap_complete" +version = "4.5.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "430b4dc2b5e3861848de79627b2bedc9f3342c7da5173a14eaa5d0f8dc18ae5d" +dependencies = [ + "clap", +] + +[[package]] +name = "clap_complete_nushell" +version = "4.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "685bc86fd34b7467e0532a4f8435ab107960d69a243785ef0275e571b35b641a" +dependencies = [ + "clap", + "clap_complete", +] + +[[package]] +name = "clap_lex" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3e64b0cc0439b12df2fa678eae89a1c56a529fd067a9115f7827f1fffd22b32" + [[package]] name = "clipboard-win" version = "5.4.1" @@ -692,6 +865,33 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "color-eyre" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5920befb47832a6d61ee3a3a846565cfa39b331331e68a3b1d1116630f2f26d" +dependencies = [ + "backtrace", + "color-spantrace", + "eyre", + "indenter", + "once_cell", + "owo-colors", + "tracing-error", +] + +[[package]] +name = "color-spantrace" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8b88ea9df13354b55bc7234ebcce36e6ef896aca2e42a15de9e10edce01b427" +dependencies = [ + "once_cell", + "owo-colors", + "tracing-core", + "tracing-error", +] + [[package]] name = "color_quant" version = "1.1.0" @@ -708,6 +908,20 @@ dependencies = [ "memchr", ] +[[package]] +name = "compact_str" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb1325a1cece981e8a296ab8f0f9b63ae357bd0784a9faaf548cc7b480707a" +dependencies = [ + "castaway", + "cfg-if", + "itoa", + "rustversion", + "ryu", + "static_assertions", +] + [[package]] name = "concurrent-queue" version = "2.5.0" @@ -717,6 +931,15 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "convert_case" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "633458d4ef8c78b72454de2d54fd6ab2e60f9e02be22f3c6104cdc8a4e0fceb9" +dependencies = [ + "unicode-segmentation", +] + [[package]] name = "core-foundation" version = "0.9.4" @@ -820,6 +1043,15 @@ dependencies = [ "unicode-segmentation", ] +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + [[package]] name = "crc32fast" version = "1.5.0" @@ -863,6 +1095,36 @@ version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" +[[package]] +name = "crossterm" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8b9f2e4c67f833b660cdb0a3523065869fb35570177239812ed4c905aeff87b" +dependencies = [ + "bitflags 2.10.0", + "crossterm_winapi", + "derive_more", + "document-features", + "filedescriptor", + "futures-core", + "libc", + "mio", + "parking_lot", + "rustix 1.1.3", + "signal-hook", + "signal-hook-mio", + "winapi", +] + +[[package]] +name = "crossterm_winapi" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acdd7c62a3665c7f6830a51635d9ac9b23ed385797f70a83bb8bafe9c572ab2b" +dependencies = [ + "winapi", +] + [[package]] name = "crunchy" version = "0.2.4" @@ -882,6 +1144,26 @@ dependencies = [ "wgpu", ] +[[package]] +name = "crypto-common" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "csscolorparser" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb2a7d3066da2de787b7f032c736763eb7ae5d355f81a68bab2675a96008b0bf" +dependencies = [ + "lab", + "phf 0.11.3", +] + [[package]] name = "ctor-lite" version = "0.1.0" @@ -894,6 +1176,85 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f27ae1dd37df86211c42e150270f82743308803d90a6f6e6651cd730d5e1732f" +[[package]] +name = "darling" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" +dependencies = [ + "darling_core 0.20.11", + "darling_macro 0.20.11", +] + +[[package]] +name = "darling" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25ae13da2f202d56bd7f91c25fba009e7717a1e4a1cc98a76d844b65ae912e9d" +dependencies = [ + "darling_core 0.23.0", + "darling_macro 0.23.0", +] + +[[package]] +name = "darling_core" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 2.0.114", +] + +[[package]] +name = "darling_core" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9865a50f7c335f53564bb694ef660825eb8610e0a53d3e11bf1b0d3df31e03b0" +dependencies = [ + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 2.0.114", +] + +[[package]] +name = "darling_macro" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" +dependencies = [ + "darling_core 0.20.11", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "darling_macro" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3984ec7bd6cfa798e62b4a642426a5be0e68f9401cfc2a01e3fa9ea2fcdb8d" +dependencies = [ + "darling_core 0.23.0", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "defer-drop" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f613ec9fa66a6b28cdb1842b27f9adf24f39f9afc4dcdd9fdecee4aca7945c57" +dependencies = [ + "crossbeam-channel", + "once_cell", +] + [[package]] name = "deflate" version = "0.8.6" @@ -904,6 +1265,84 @@ dependencies = [ "byteorder", ] +[[package]] +name = "deltae" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5729f5117e208430e437df2f4843f5e5952997175992d1414f94c57d61e270b4" + +[[package]] +name = "deranged" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ececcb659e7ba858fb4f10388c250a7252eb0a27373f1a72b8748afdd248e587" +dependencies = [ + "powerfmt", +] + +[[package]] +name = "derive_builder" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "507dfb09ea8b7fa618fcf76e953f4f5e192547945816d5358edffe39f6f94947" +dependencies = [ + "derive_builder_macro", +] + +[[package]] +name = "derive_builder_core" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d5bcf7b024d6835cfb3d473887cd966994907effbe9227e8c8219824d06c4e8" +dependencies = [ + "darling 0.20.11", + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "derive_builder_macro" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab63b0e2bf4d5928aff72e83a7dace85d7bba5fe12dcc3c5a572d78caffd3f3c" +dependencies = [ + "derive_builder_core", + "syn 2.0.114", +] + +[[package]] +name = "derive_more" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d751e9e49156b02b44f9c1815bcb94b984cdcc4396ecc32521c739452808b134" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "799a97264921d8623a957f6c3b9011f3b5492f557bbb7a5a19b7fa6d06ba8dcb" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "rustc_version", + "syn 2.0.114", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", +] + [[package]] name = "dirs" version = "6.0.0" @@ -961,6 +1400,12 @@ dependencies = [ "libloading 0.8.9", ] +[[package]] +name = "doctest-file" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aac81fa3e28d21450aa4d2ac065992ba96a1d7303efbce51a95f4fd175b67562" + [[package]] name = "document-features" version = "0.2.12" @@ -994,7 +1439,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "50c1c1870b766fc398e5f0526498d09c94b6de15be5fd769a28bbc804fb1b05d" dependencies = [ - "phf", + "phf 0.13.1", ] [[package]] @@ -1024,6 +1469,12 @@ dependencies = [ "syn 2.0.114", ] +[[package]] +name = "env_home" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7f84e12ccf0a7ddc17a6c41c93326024c42920d7ee630d04950e6926645c0fe" + [[package]] name = "equator" version = "0.4.2" @@ -1121,6 +1572,26 @@ dependencies = [ "zune-inflate", ] +[[package]] +name = "eyre" +version = "0.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cd915d99f24784cdc19fd37ef22b97e3ff0ae756c7e492e9fbfe897d61e2aec" +dependencies = [ + "indenter", + "once_cell", +] + +[[package]] +name = "fancy-regex" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b95f7c0680e4142284cf8b22c14a476e87d61b004a3a0861872b32ef7ead40a2" +dependencies = [ + "bit-set 0.5.3", + "regex", +] + [[package]] name = "fastrand" version = "2.3.0" @@ -1166,12 +1637,35 @@ dependencies = [ "rustc_version", ] +[[package]] +name = "filedescriptor" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e40758ed24c9b2eeb76c35fb0aebc66c626084edd827e07e1552279814c6682d" +dependencies = [ + "libc", + "thiserror 1.0.69", + "winapi", +] + [[package]] name = "find-msvc-tools" version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8591b0bcc8a98a64310a2fae1bb3e9b8564dd10e381e6e28010fde8e8e8568db" +[[package]] +name = "finl_unicode" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9844ddc3a6e533d62bba727eb6c28b5d360921d5175e9ff0f1e621a5c590a4d5" + +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + [[package]] name = "flate2" version = "1.1.8" @@ -1182,6 +1676,12 @@ dependencies = [ "miniz_oxide 0.8.9", ] +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + [[package]] name = "foldhash" version = "0.1.5" @@ -1423,6 +1923,16 @@ dependencies = [ "system-deps", ] +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + [[package]] name = "gethostname" version = "1.1.0" @@ -1466,6 +1976,12 @@ dependencies = [ "weezl", ] +[[package]] +name = "gimli" +version = "0.32.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e629b9b98ef3dd8afe6ca2bd0f89306cec16d43d907889945bc5d6687f2f13c7" + [[package]] name = "gio" version = "0.18.4" @@ -1764,6 +2280,8 @@ version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" dependencies = [ + "allocator-api2", + "equivalent", "foldhash 0.2.0", ] @@ -2076,6 +2594,12 @@ dependencies = [ "zerovec", ] +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + [[package]] name = "idna" version = "1.1.0" @@ -2137,6 +2661,12 @@ version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e7c5cedc30da3a610cac6b4ba17597bdf7152cf974e8aab3afb3d54455e371c8" +[[package]] +name = "indenter" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "964de6e86d545b246d84badc0fef527924ace5134f30641c203ef52ba83f58d5" + [[package]] name = "indexmap" version = "2.13.0" @@ -2147,6 +2677,28 @@ dependencies = [ "hashbrown 0.16.1", ] +[[package]] +name = "indoc" +version = "2.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79cf5c93f93228cf8efb3ba362535fb11199ac548a09ce117c9b1adc3030d706" +dependencies = [ + "rustversion", +] + +[[package]] +name = "instability" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "357b7205c6cd18dd2c86ed312d1e70add149aea98e7ef72b9fdf0270e555c11d" +dependencies = [ + "darling 0.23.0", + "indoc", + "proc-macro2", + "quote", + "syn 2.0.114", +] + [[package]] name = "interpolate_name" version = "0.2.4" @@ -2158,6 +2710,21 @@ dependencies = [ "syn 2.0.114", ] +[[package]] +name = "interprocess" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d941b405bd2322993887859a8ee6ac9134945a24ec5ec763a8a962fc64dfec2d" +dependencies = [ + "doctest-file", + "futures-core", + "libc", + "recvmsg", + "tokio", + "widestring", + "windows-sys 0.52.0", +] + [[package]] name = "itertools" version = "0.14.0" @@ -2167,6 +2734,12 @@ dependencies = [ "either", ] +[[package]] +name = "itoa" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2" + [[package]] name = "jni" version = "0.21.1" @@ -2213,9 +2786,20 @@ dependencies = [ name = "kamadak-exif" version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1130d80c7374efad55a117d715a3af9368f0fa7a2c54573afc15a188cd984837" +checksum = "1130d80c7374efad55a117d715a3af9368f0fa7a2c54573afc15a188cd984837" +dependencies = [ + "mutate_once", +] + +[[package]] +name = "kasuari" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fe90c1150662e858c7d5f945089b7517b0a80d8bf7ba4b1b5ffc984e7230a5b" dependencies = [ - "mutate_once", + "hashbrown 0.16.1", + "portable-atomic", + "thiserror 2.0.18", ] [[package]] @@ -2256,6 +2840,18 @@ dependencies = [ "smallvec", ] +[[package]] +name = "lab" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf36173d4167ed999940f804952e6b08197cae5ad5d572eb4db150ce8ad5d58f" + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + [[package]] name = "lebe" version = "0.5.3" @@ -2367,6 +2963,15 @@ dependencies = [ "web-time", ] +[[package]] +name = "line-clipping" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f4de44e98ddbf09375cbf4d17714d18f39195f4f4894e8524501726fd9a8a4a" +dependencies = [ + "bitflags 2.10.0", +] + [[package]] name = "linebender_resource_handle" version = "0.1.1" @@ -2426,6 +3031,19 @@ name = "lru" version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1dc47f592c06f33f8e3aea9591776ec7c9f9e4124778ff8a3c3b87159f7e593" +dependencies = [ + "hashbrown 0.16.1", +] + +[[package]] +name = "mac_address" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0aeb26bf5e836cc1c341c8106051b573f1766dfa05aa87f0b98be5e51b02303" +dependencies = [ + "nix 0.29.0", + "winapi", +] [[package]] name = "malloc_buf" @@ -2461,6 +3079,12 @@ dependencies = [ "libc", ] +[[package]] +name = "memmem" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a64a92489e2744ce060c349162be1c5f33c6969234104dbd99ddb5feb08b8c15" + [[package]] name = "memoffset" version = "0.9.1" @@ -2485,6 +3109,12 @@ dependencies = [ "paste", ] +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + [[package]] name = "miniz_oxide" version = "0.3.7" @@ -2511,6 +3141,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a69bcab0ad47271a0234d9422b131806bf3968021e5dc9328caf2d4cd58557fc" dependencies = [ "libc", + "log", "wasi", "windows-sys 0.61.2", ] @@ -2584,7 +3215,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "066cf25f0e8b11ee0df221219010f213ad429855f57c494f995590c861a9a7d8" dependencies = [ "arrayvec", - "bit-set", + "bit-set 0.8.0", "bitflags 2.10.0", "cfg-if", "cfg_aliases", @@ -2639,6 +3270,41 @@ version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" +[[package]] +name = "nix" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" +dependencies = [ + "bitflags 2.10.0", + "cfg-if", + "cfg_aliases", + "libc", + "memoffset", +] + +[[package]] +name = "nix" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74523f3a35e05aba87a1d978330aef40f67b0304ac79c1c00b294c9830543db6" +dependencies = [ + "bitflags 2.10.0", + "cfg-if", + "cfg_aliases", + "libc", +] + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + [[package]] name = "nom" version = "8.0.0" @@ -2664,6 +3330,12 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-conv" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf97ec579c3c42f953ef76dbf8d55ac91fb219dde70e49aa4a6b7d74e9919050" + [[package]] name = "num-derive" version = "0.4.2" @@ -2737,6 +3409,21 @@ dependencies = [ "syn 2.0.114", ] +[[package]] +name = "num_threads" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c7398b9c8b70908f6371f47ed36737907c87c52af34c268fed0bf0ceb92ead9" +dependencies = [ + "libc", +] + +[[package]] +name = "numtoa" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6aa2c4e539b869820a2b82e1aef6ff40aa85e65decdd5185e83fb4b1249cd00f" + [[package]] name = "objc" version = "0.2.7" @@ -3107,6 +3794,15 @@ dependencies = [ "objc2-foundation 0.2.2", ] +[[package]] +name = "object" +version = "0.37.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff76201f031d8863c38aa7f905eca4f53abbfa15f609db4277d44cd8938f33fe" +dependencies = [ + "memchr", +] + [[package]] name = "once_cell" version = "1.21.3" @@ -3129,6 +3825,15 @@ dependencies = [ "libredox", ] +[[package]] +name = "ordered-float" +version = "4.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7bb71e1b3fa6ca1c61f383464aaf2bb0e2f8e772a1f01d486832464de363b951" +dependencies = [ + "num-traits", +] + [[package]] name = "ordered-float" version = "5.1.0" @@ -3157,6 +3862,12 @@ dependencies = [ "ttf-parser", ] +[[package]] +name = "owo-colors" +version = "4.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c6901729fa79e91a0913333229e9ca5dc725089d1c363b2f4b4760709dc4a52" + [[package]] name = "pango" version = "0.18.3" @@ -3229,13 +3940,108 @@ version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" +[[package]] +name = "pest" +version = "2.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c9eb05c21a464ea704b53158d358a31e6425db2f63a1a7312268b05fe2b75f7" +dependencies = [ + "memchr", + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68f9dbced329c441fa79d80472764b1a2c7e57123553b8519b36663a2fb234ed" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3bb96d5051a78f44f43c8f712d8e810adb0ebf923fc9ed2655a7f66f63ba8ee5" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "pest_meta" +version = "2.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "602113b5b5e8621770cfd490cfd90b9f84ab29bd2b0e49ad83eb6d186cef2365" +dependencies = [ + "pest", + "sha2", +] + +[[package]] +name = "phf" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" +dependencies = [ + "phf_macros", + "phf_shared 0.11.3", +] + [[package]] name = "phf" version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1562dc717473dbaa4c1f85a36410e03c047b2e7df7f45ee938fbef64ae7fadf" dependencies = [ - "phf_shared", + "phf_shared 0.13.1", +] + +[[package]] +name = "phf_codegen" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aef8048c789fa5e851558d709946d6d79a8ff88c0440c587967f8e94bfb1216a" +dependencies = [ + "phf_generator", + "phf_shared 0.11.3", +] + +[[package]] +name = "phf_generator" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" +dependencies = [ + "phf_shared 0.11.3", + "rand 0.8.5", +] + +[[package]] +name = "phf_macros" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216" +dependencies = [ + "phf_generator", + "phf_shared 0.11.3", + "proc-macro2", + "quote", + "syn 2.0.114", +] + +[[package]] +name = "phf_shared" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" +dependencies = [ + "siphasher", ] [[package]] @@ -3372,6 +4178,12 @@ dependencies = [ "zerovec", ] +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + [[package]] name = "ppv-lite86" version = "0.2.21" @@ -3516,6 +4328,15 @@ version = "5.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "rand_core 0.6.4", +] + [[package]] name = "rand" version = "0.9.2" @@ -3523,7 +4344,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" dependencies = [ "rand_chacha", - "rand_core", + "rand_core 0.9.5", ] [[package]] @@ -3533,9 +4354,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" dependencies = [ "ppv-lite86", - "rand_core", + "rand_core 0.9.5", ] +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" + [[package]] name = "rand_core" version = "0.9.5" @@ -3557,6 +4384,91 @@ version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "973443cf09a9c8656b574a866ab68dfa19f0867d0340648c7d2f6a71b8a8ea68" +[[package]] +name = "ratatui" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1ce67fb8ba4446454d1c8dbaeda0557ff5e94d39d5e5ed7f10a65eb4c8266bc" +dependencies = [ + "instability", + "ratatui-core", + "ratatui-crossterm", + "ratatui-macros", + "ratatui-termwiz", + "ratatui-widgets", +] + +[[package]] +name = "ratatui-core" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ef8dea09a92caaf73bff7adb70b76162e5937524058a7e5bff37869cbbec293" +dependencies = [ + "bitflags 2.10.0", + "compact_str", + "hashbrown 0.16.1", + "indoc", + "itertools", + "kasuari", + "lru", + "strum", + "thiserror 2.0.18", + "unicode-segmentation", + "unicode-truncate", + "unicode-width", +] + +[[package]] +name = "ratatui-crossterm" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "577c9b9f652b4c121fb25c6a391dd06406d3b092ba68827e6d2f09550edc54b3" +dependencies = [ + "cfg-if", + "crossterm", + "instability", + "ratatui-core", +] + +[[package]] +name = "ratatui-macros" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7f1342a13e83e4bb9d0b793d0ea762be633f9582048c892ae9041ef39c936f4" +dependencies = [ + "ratatui-core", + "ratatui-widgets", +] + +[[package]] +name = "ratatui-termwiz" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f76fe0bd0ed4295f0321b1676732e2454024c15a35d01904ddb315afd3d545c" +dependencies = [ + "ratatui-core", + "termwiz", +] + +[[package]] +name = "ratatui-widgets" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7dbfa023cd4e604c2553483820c5fe8aa9d71a42eea5aa77c6e7f35756612db" +dependencies = [ + "bitflags 2.10.0", + "hashbrown 0.16.1", + "indoc", + "instability", + "itertools", + "line-clipping", + "ratatui-core", + "strum", + "time", + "unicode-segmentation", + "unicode-width", +] + [[package]] name = "rav1e" version = "0.8.1" @@ -3584,7 +4496,7 @@ dependencies = [ "num-traits", "paste", "profiling", - "rand", + "rand 0.9.2", "rand_chacha", "simd_helpers", "thiserror 2.0.18", @@ -3644,6 +4556,12 @@ dependencies = [ "font-types", ] +[[package]] +name = "recvmsg" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3edd4d5d42c92f0a659926464d4cce56b562761267ecf0f469d85b7de384175" + [[package]] name = "redox_syscall" version = "0.4.1" @@ -3682,6 +4600,35 @@ dependencies = [ "thiserror 2.0.18", ] +[[package]] +name = "regex" +version = "1.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "843bc0191f75f3e22651ae5f1e72939ab2f72a4bc30fa80a066bd66edefc24d4" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5276caf25ac86c8d810222b3dbb938e512c55c6831a10f3e6ed1c93b84041f1c" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58" + [[package]] name = "renderdoc-sys" version = "1.1.0" @@ -3694,12 +4641,38 @@ version = "0.8.52" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c6a884d2998352bb4daf0183589aec883f16a6da1f4dde84d8e2e9a5409a1ce" +[[package]] +name = "roff" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88f8660c1ff60292143c98d08fc6e2f654d722db50410e3f3797d40baaf9d8f3" + +[[package]] +name = "ron" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd490c5b18261893f14449cbd28cb9c0b637aebf161cd77900bfdedaff21ec32" +dependencies = [ + "bitflags 2.10.0", + "once_cell", + "serde", + "serde_derive", + "typeid", + "unicode-ident", +] + [[package]] name = "roxmltree" version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c20b6793b5c2fa6553b250154b78d6d0db37e72700ae35fad9387a46f487c97" +[[package]] +name = "rustc-demangle" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b50b8869d9fc858ce7266cce0194bd74df58b9d0e3f6df3a9fc8eb470d95c09d" + [[package]] name = "rustc-hash" version = "1.1.0" @@ -3739,9 +4712,10 @@ dependencies = [ "objc2-core-foundation", "objc2-foundation 0.3.2", "once_cell", - "rand", + "rand 0.9.2", "rayon", "serde", + "skim", "tokio", "toml 0.9.11+spec-1.1.0", "tray-icon", @@ -3775,10 +4749,16 @@ dependencies = [ ] [[package]] -name = "rustversion" +name = "rustversion" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" + +[[package]] +name = "ryu" version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" +checksum = "a50f4cf475b65d88e057964e0e9bb1f0aa9bbb2036dc65c64596b42932536984" [[package]] name = "same-file" @@ -3885,12 +4865,62 @@ dependencies = [ "serde_core", ] +[[package]] +name = "sha2" +version = "0.10.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "shell-quote" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb502615975ae2365825521fa1529ca7648fd03ce0b0746604e0683856ecd7e4" +dependencies = [ + "bstr", +] + [[package]] name = "shlex" version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" +[[package]] +name = "signal-hook" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d881a16cf4426aa584979d30bd82cb33429027e42122b169753d6ef1085ed6e2" +dependencies = [ + "libc", + "signal-hook-registry", +] + +[[package]] +name = "signal-hook-mio" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b75a19a7a740b25bc7944bdee6172368f988763b744e3d4dfe753f6b4ece40cc" +dependencies = [ + "libc", + "mio", + "signal-hook", +] + [[package]] name = "signal-hook-registry" version = "1.4.8" @@ -3916,12 +4946,56 @@ dependencies = [ "quote", ] +[[package]] +name = "simdutf8" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" + [[package]] name = "siphasher" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" +[[package]] +name = "skim" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a23e0738812a9143fee6e0965e29992a4b1ace6c3d31167080d8b5e6d04d9b1" +dependencies = [ + "ansi-to-tui", + "assert_enum_variants", + "beef", + "clap_complete_nushell", + "color-eyre", + "crossterm", + "defer-drop", + "derive_builder", + "futures", + "indexmap", + "interprocess", + "log", + "nix 0.30.1", + "rand 0.9.2", + "ratatui", + "rayon", + "regex", + "roff", + "ron", + "serde", + "shell-quote", + "tempfile", + "termion", + "thiserror 2.0.18", + "thread_local", + "tokio", + "tokio-util", + "unicode-display-width", + "vte", + "which", +] + [[package]] name = "skrifa" version = "0.37.0" @@ -4093,6 +5167,33 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6637bab7722d379c8b41ba849228d680cc12d0a45ba1fa2b48f2a30577a06731" +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "strum" +version = "0.27.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af23d6f6c1a224baef9d3f61e287d2761385a5b88fdab4eb4c6f11aeb54c4bcf" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.27.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7695ce3845ea4b33927c055a39dc438a45b059f7c1b3d91d38d10355fb8cbca7" +dependencies = [ + "heck 0.5.0", + "proc-macro2", + "quote", + "syn 2.0.114", +] + [[package]] name = "svg_fmt" version = "0.4.5" @@ -4117,6 +5218,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2", + "quote", "unicode-ident", ] @@ -4192,6 +5294,79 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "terminfo" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4ea810f0692f9f51b382fff5893887bb4580f5fa246fde546e0b13e7fcee662" +dependencies = [ + "fnv", + "nom 7.1.3", + "phf 0.11.3", + "phf_codegen", +] + +[[package]] +name = "termion" +version = "4.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f44138a9ae08f0f502f24104d82517ef4da7330c35acd638f1f29d3cd5475ecb" +dependencies = [ + "libc", + "numtoa", +] + +[[package]] +name = "termios" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "411c5bf740737c7918b8b1fe232dca4dc9f8e754b8ad5e20966814001ed0ac6b" +dependencies = [ + "libc", +] + +[[package]] +name = "termwiz" +version = "0.23.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4676b37242ccbd1aabf56edb093a4827dc49086c0ffd764a5705899e0f35f8f7" +dependencies = [ + "anyhow", + "base64", + "bitflags 2.10.0", + "fancy-regex", + "filedescriptor", + "finl_unicode", + "fixedbitset", + "hex", + "lazy_static", + "libc", + "log", + "memmem", + "nix 0.29.0", + "num-derive", + "num-traits", + "ordered-float 4.6.0", + "pest", + "pest_derive", + "phf 0.11.3", + "sha2", + "signal-hook", + "siphasher", + "terminfo", + "termios", + "thiserror 1.0.69", + "ucd-trie", + "unicode-segmentation", + "vtparse", + "wezterm-bidi", + "wezterm-blob-leases", + "wezterm-color-types", + "wezterm-dynamic", + "wezterm-input-types", + "winapi", +] + [[package]] name = "thiserror" version = "1.0.69" @@ -4232,6 +5407,15 @@ dependencies = [ "syn 2.0.114", ] +[[package]] +name = "thread_local" +version = "1.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" +dependencies = [ + "cfg-if", +] + [[package]] name = "tiff" version = "0.10.3" @@ -4246,6 +5430,27 @@ dependencies = [ "zune-jpeg 0.4.21", ] +[[package]] +name = "time" +version = "0.3.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9da98b7d9b7dad93488a84b8248efc35352b0b2657397d4167e7ad67e5d535e5" +dependencies = [ + "deranged", + "libc", + "num-conv", + "num_threads", + "powerfmt", + "serde_core", + "time-core", +] + +[[package]] +name = "time-core" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7694e1cfe791f8d31026952abf09c69ca6f6fa4e1a1229e18988f06a04a12dca" + [[package]] name = "tiny-skia" version = "0.11.4" @@ -4337,6 +5542,19 @@ dependencies = [ "syn 2.0.114", ] +[[package]] +name = "tokio-util" +version = "0.7.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ae9cec805b01e8fc3fd2fe289f89149a9b66dd16786abd8b19cfa7b48cb0098" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", +] + [[package]] name = "toml" version = "0.8.2" @@ -4463,6 +5681,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" dependencies = [ "once_cell", + "valuable", +] + +[[package]] +name = "tracing-error" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b1581020d7a273442f5b45074a6a57d5757ad0a47dac0e9f0bd57b81936f3db" +dependencies = [ + "tracing", + "tracing-subscriber", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f30143827ddab0d256fd843b7a66d164e9f271cfa0dde49142c5ca0ca291f1e" +dependencies = [ + "sharded-slab", + "thread_local", + "tracing-core", ] [[package]] @@ -4495,6 +5735,24 @@ dependencies = [ "core_maths", ] +[[package]] +name = "typeid" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c" + +[[package]] +name = "typenum" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb" + +[[package]] +name = "ucd-trie" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" + [[package]] name = "uds_windows" version = "1.1.0" @@ -4512,6 +5770,15 @@ version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5" +[[package]] +name = "unicode-display-width" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a43273b656140aa2bb8e65351fe87c255f0eca706b2538a9bd4a590a3490bf3" +dependencies = [ + "unicode-segmentation", +] + [[package]] name = "unicode-ident" version = "1.0.22" @@ -4536,6 +5803,17 @@ version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" +[[package]] +name = "unicode-truncate" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16b380a1238663e5f8a691f9039c73e1cdae598a30e9855f541d29b08b53e9a5" +dependencies = [ + "itertools", + "unicode-segmentation", + "unicode-width", +] + [[package]] name = "unicode-width" version = "0.2.2" @@ -4559,12 +5837,20 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + [[package]] name = "uuid" version = "1.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee48d38b119b0cd71fe4141b30f5ba9c7c5d9f4e7a3a8b4a674e4b6ef789976f" dependencies = [ + "atomic", + "getrandom 0.3.4", "js-sys", "serde_core", "wasm-bindgen", @@ -4581,6 +5867,12 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "valuable" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" + [[package]] name = "version-compare" version = "0.2.1" @@ -4593,6 +5885,25 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" +[[package]] +name = "vte" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5924018406ce0063cd67f8e008104968b74b563ee1b85dde3ed1f7cb87d3dbd" +dependencies = [ + "arrayvec", + "memchr", +] + +[[package]] +name = "vtparse" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d9b2acfb050df409c972a37d3b8e08cdea3bddb0c09db9d53137e504cfabed0" +dependencies = [ + "utf8parse", +] + [[package]] name = "walkdir" version = "2.5.0" @@ -4852,6 +6163,78 @@ version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a28ac98ddc8b9274cb41bb4d9d4d5c425b6020c50c46f25559911905610b4a88" +[[package]] +name = "wezterm-bidi" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c0a6e355560527dd2d1cf7890652f4f09bb3433b6aadade4c9b5ed76de5f3ec" +dependencies = [ + "log", + "wezterm-dynamic", +] + +[[package]] +name = "wezterm-blob-leases" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "692daff6d93d94e29e4114544ef6d5c942a7ed998b37abdc19b17136ea428eb7" +dependencies = [ + "getrandom 0.3.4", + "mac_address", + "sha2", + "thiserror 1.0.69", + "uuid", +] + +[[package]] +name = "wezterm-color-types" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7de81ef35c9010270d63772bebef2f2d6d1f2d20a983d27505ac850b8c4b4296" +dependencies = [ + "csscolorparser", + "deltae", + "lazy_static", + "wezterm-dynamic", +] + +[[package]] +name = "wezterm-dynamic" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f2ab60e120fd6eaa68d9567f3226e876684639d22a4219b313ff69ec0ccd5ac" +dependencies = [ + "log", + "ordered-float 4.6.0", + "strsim", + "thiserror 1.0.69", + "wezterm-dynamic-derive", +] + +[[package]] +name = "wezterm-dynamic-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46c0cf2d539c645b448eaffec9ec494b8b19bd5077d9e58cb1ae7efece8d575b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "wezterm-input-types" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7012add459f951456ec9d6c7e6fc340b1ce15d6fc9629f8c42853412c029e57e" +dependencies = [ + "bitflags 1.3.2", + "euclid", + "lazy_static", + "serde", + "wezterm-dynamic", +] + [[package]] name = "wgpu" version = "27.0.1" @@ -4888,8 +6271,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "27a75de515543b1897b26119f93731b385a19aea165a1ec5f0e3acecc229cae7" dependencies = [ "arrayvec", - "bit-set", - "bit-vec", + "bit-set 0.8.0", + "bit-vec 0.8.0", "bitflags 2.10.0", "bytemuck", "cfg_aliases", @@ -4949,7 +6332,7 @@ dependencies = [ "android_system_properties", "arrayvec", "ash", - "bit-set", + "bit-set 0.8.0", "bitflags 2.10.0", "block", "bytemuck", @@ -4972,7 +6355,7 @@ dependencies = [ "ndk-sys", "objc", "once_cell", - "ordered-float", + "ordered-float 5.1.0", "parking_lot", "portable-atomic", "portable-atomic-util", @@ -5003,6 +6386,23 @@ dependencies = [ "web-sys", ] +[[package]] +name = "which" +version = "8.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3fabb953106c3c8eea8306e4393700d7657561cb43122571b172bbfb7c7ba1d" +dependencies = [ + "env_home", + "rustix 1.1.3", + "winsafe", +] + +[[package]] +name = "widestring" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72069c3113ab32ab29e5584db3c6ec55d416895e60715417b5b883a357c3e471" + [[package]] name = "winapi" version = "0.3.9" @@ -5523,6 +6923,12 @@ dependencies = [ "memchr", ] +[[package]] +name = "winsafe" +version = "0.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d135d17ab770252ad95e9a872d365cf3090e3be864a34ab46f48555993efc904" + [[package]] name = "wit-bindgen" version = "0.51.0" diff --git a/Cargo.toml b/Cargo.toml index 89bc634..94946ef 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,6 +24,7 @@ once_cell = "1.21.3" rand = "0.9.2" rayon = "1.11.0" serde = { version = "1.0.228", features = ["derive"] } +skim = {version = "1.8.1", default-features = false} tokio = { version = "1.48.0", features = ["full"] } toml = "0.9.8" tray-icon = "0.21.3" diff --git a/src/app/apps.rs b/src/app/apps.rs index 29f7c75..1e102ee 100644 --- a/src/app/apps.rs +++ b/src/app/apps.rs @@ -1,7 +1,7 @@ //! This modules handles the logic for each "app" that rustcast can load //! //! An "app" is effectively, one of the results that rustcast returns when you search for something -use std::path::Path; +use std::{borrow::Cow, path::Path}; use iced::{ Alignment, @@ -34,18 +34,14 @@ pub enum AppCommand { #[derive(Debug, Clone)] pub struct App { pub open_command: AppCommand, - pub desc: String, + pub desc: Cow<'static, str>, pub icons: Option, - pub name: String, - pub name_lc: String, + pub name: Cow<'static, str>, } impl PartialEq for App { fn eq(&self, other: &Self) -> bool { - self.name_lc == other.name_lc - && self.icons == other.icons - && self.desc == other.desc - && self.name == other.name + self.icons == other.icons && self.desc == other.desc && self.name == other.name } } @@ -54,14 +50,13 @@ impl App { pub fn emoji_apps() -> Vec { emojis::iter() .filter(|x| x.unicode_version() < emojis::UnicodeVersion::new(17, 13)) - .map(|x| App { + .map(|emoji| App { icons: None, - name: x.to_string(), - name_lc: x.name().to_string(), + name: Cow::Borrowed(emoji.as_str()), open_command: AppCommand::Function(Function::CopyToClipboard( - ClipBoardContentType::Text(x.to_string()), + ClipBoardContentType::Text(Cow::Borrowed(emoji.as_str())), )), - desc: x.name().to_string(), + desc: Cow::Borrowed(emoji.name()), }) .collect() } @@ -72,57 +67,51 @@ impl App { vec![ App { open_command: AppCommand::Function(Function::Quit), - desc: RUSTCAST_DESC_NAME.to_string(), + desc: Cow::Borrowed(RUSTCAST_DESC_NAME), icons: handle_from_icns(Path::new( "/Applications/Rustcast.app/Contents/Resources/icon.icns", )), - name: "Quit RustCast".to_string(), - name_lc: "quit".to_string(), + name: Cow::Borrowed("Quit RustCast"), }, App { open_command: AppCommand::Function(Function::OpenPrefPane), - desc: RUSTCAST_DESC_NAME.to_string(), + desc: Cow::Borrowed(RUSTCAST_DESC_NAME), icons: handle_from_icns(Path::new( "/Applications/Rustcast.app/Contents/Resources/icon.icns", )), - name: "Open RustCast Preferences".to_string(), - name_lc: "settings".to_string(), + name: Cow::Borrowed("Open RustCast Preferences"), }, App { open_command: AppCommand::Message(Message::SwitchToPage(Page::EmojiSearch)), - desc: RUSTCAST_DESC_NAME.to_string(), + desc: Cow::Borrowed(RUSTCAST_DESC_NAME), icons: handle_from_icns(Path::new( "/Applications/Rustcast.app/Contents/Resources/icon.icns", )), - name: "Search for an Emoji".to_string(), - name_lc: "emoji".to_string(), + name: Cow::Borrowed("Search for an Emoji"), }, App { open_command: AppCommand::Message(Message::SwitchToPage(Page::ClipboardHistory)), - desc: RUSTCAST_DESC_NAME.to_string(), + desc: Cow::Borrowed(RUSTCAST_DESC_NAME), icons: handle_from_icns(Path::new( "/Applications/Rustcast.app/Contents/Resources/icon.icns", )), - name: "Clipboard History".to_string(), - name_lc: "clipboard".to_string(), + name: Cow::Borrowed("Clipboard History"), }, App { open_command: AppCommand::Message(Message::ReloadConfig), - desc: RUSTCAST_DESC_NAME.to_string(), + desc: Cow::Borrowed(RUSTCAST_DESC_NAME), icons: handle_from_icns(Path::new( "/Applications/Rustcast.app/Contents/Resources/icon.icns", )), - name: "Reload RustCast".to_string(), - name_lc: "refresh".to_string(), + name: Cow::Borrowed("Reload RustCast"), }, App { open_command: AppCommand::Display, - desc: RUSTCAST_DESC_NAME.to_string(), + desc: Cow::Borrowed(RUSTCAST_DESC_NAME), icons: handle_from_icns(Path::new( "/Applications/Rustcast.app/Contents/Resources/icon.icns", )), - name: format!("Current RustCast Version: {app_version}"), - name_lc: "version".to_string(), + name: Cow::Owned(format!("Current RustCast Version: {app_version}")), }, ] } diff --git a/src/app/pages/clipboard.rs b/src/app/pages/clipboard.rs index 6bf5473..574aa94 100644 --- a/src/app/pages/clipboard.rs +++ b/src/app/pages/clipboard.rs @@ -1,3 +1,5 @@ +use std::borrow::Cow; + use iced::widget::{ Scrollable, scrollable, scrollable::{Direction, Scrollbar}, @@ -30,8 +32,8 @@ pub fn clipboard_view( Text::new( clipboard_content .get(focussed_id as usize) - .map(|x| x.to_app().name_lc) - .unwrap_or("".to_string()), + .map(|entry| entry.to_app().name) + .unwrap_or(Cow::Borrowed("")), ) .height(385) .width(Length::Fill) diff --git a/src/app/tile.rs b/src/app/tile.rs index f17319e..8697924 100644 --- a/src/app/tile.rs +++ b/src/app/tile.rs @@ -25,12 +25,13 @@ use iced::{event, window}; use objc2::rc::Retained; use objc2_app_kit::NSRunningApplication; use rayon::iter::{IntoParallelRefIterator, ParallelIterator}; +use skim::{fuzzy_matcher::FuzzyMatcher, prelude::SkimMatcherV2}; use tray_icon::TrayIcon; -use std::fs; -use std::ops::Bound; +use std::{borrow::Cow, fs}; + +use std::path::Path; use std::time::Duration; -use std::{collections::BTreeMap, path::Path}; /// This is a wrapper around the sender to disable dropping #[derive(Clone, Debug)] @@ -42,52 +43,52 @@ impl Drop for ExtSender { } /// All the indexed apps that rustcast can search for -#[derive(Clone, Debug)] +#[derive(Debug)] struct AppIndex { - by_name: BTreeMap, + apps: Vec, + matcher: SkimMatcherV2, } impl AppIndex { - /// Search for an element in the index that starts with the provided prefix - fn search_prefix<'a>(&'a self, prefix: &'a str) -> impl Iterator + 'a { - self.by_name - .range::((Bound::Included(prefix), Bound::Unbounded)) - .take_while(move |(k, _)| k.starts_with(prefix)) - .map(|(_, v)| v) + fn search(&self, pattern: &str) -> Vec<(i64, &App)> { + let mut selected: Vec<_> = self + .apps + .iter() + .filter_map(|app| self.matcher.fuzzy_match(&app.name, pattern).zip(Some(app))) + .collect(); + selected.sort_by(|(score1, _), (score2, _)| score2.cmp(score1)); + + selected } /// Factory function for creating - pub fn from_apps(options: Vec) -> Self { - let mut bmap = BTreeMap::new(); - for app in options { - bmap.insert(app.name_lc.clone(), app); + pub fn from_apps(apps: Vec) -> Self { + Self { + apps, + matcher: SkimMatcherV2::default(), } - - AppIndex { by_name: bmap } } } /// This is the base window, and its a "Tile" /// Its fields are: -/// - Theme ([`iced::Theme`]) -/// - Query (String) -/// - Query Lowercase (String, but lowercase) -/// - Previous Query Lowercase (String) -/// - Results (Vec<[`App`]>) the results of the search -/// - Options (Vec<[`App`]>) the options to search through -/// - Visible (bool) whether the window is visible or not -/// - Focused (bool) whether the window is focused or not -/// - Frontmost ([`Option>`]) the frontmost application before the window was opened -/// - Config ([`Config`]) the app's config -/// - Open Hotkey ID (`u32`) the id of the hotkey that opens the window -/// - Clipboard Content (`Vec<`[`ClipBoardContentType`]`>`) all of the cliboard contents -/// - Page ([`Page`]) the current page of the window (main or clipboard history) -#[derive(Clone)] +/// - Theme ([`iced::Theme`]). +/// - Query (String). +/// - Query Lowercase (String, but lowercase). +/// - Previous Query Lowercase (String). +/// - Results (Vec<[`App`]>) the results of the search. +/// - Options (Vec<[`App`]>) the options to search through. +/// - Visible (bool) whether the window is visible or not. +/// - Focused (bool) whether the window is focused or not. +/// - Frontmost ([`Option>`]) the frontmost application before the window was opened. +/// - Config ([`Config`]) the app's config. +/// - Open Hotkey ID (`u32`) the id of the hotkey that opens the window. +/// - Clipboard Content (`Vec<`[`ClipBoardContentType`]`>`) all of the cliboard contents. +/// - Page ([`Page`]) the current page of the window (main or clipboard history). pub struct Tile { pub theme: iced::Theme, pub focus_id: u32, pub query: String, - query_lc: String, results: Vec, options: AppIndex, emoji_apps: AppIndex, @@ -206,7 +207,6 @@ impl Tile { /// should be separated out to make it easier to test. This function is called by the `update` /// function to handle the search query changed event. pub fn handle_search_query_changed(&mut self) { - let query = self.query_lc.clone(); let options = if self.page == Page::Main { &self.options } else if self.page == Page::EmojiSearch { @@ -214,12 +214,14 @@ impl Tile { } else { &AppIndex::from_apps(vec![]) }; - let results: Vec = options - .search_prefix(&query) - .map(|x| x.to_owned()) - .collect(); - self.results = results; + self.results.clear(); + self.results.extend( + options + .search(&self.query) + .into_iter() + .map(|(_, app)| app.clone()), + ); } /// Gets the frontmost application to focus later. @@ -316,8 +318,8 @@ fn handle_clipboard_history() -> impl futures::Stream { loop { let byte_rep = if let Ok(a) = clipboard.get_image() { Some(ClipBoardContentType::Image(a)) - } else if let Ok(a) = clipboard.get_text() { - Some(ClipBoardContentType::Text(a)) + } else if let Ok(value) = clipboard.get_text() { + Some(ClipBoardContentType::Text(Cow::Owned(value))) } else { None }; diff --git a/src/app/tile/elm.rs b/src/app/tile/elm.rs index 772a43d..419d3f4 100644 --- a/src/app/tile/elm.rs +++ b/src/app/tile/elm.rs @@ -45,7 +45,6 @@ pub fn new(hotkey: HotKey, config: &Config) -> (Tile, Task) { ( Tile { query: String::new(), - query_lc: String::new(), focus_id: 0, results: vec![], options, @@ -110,8 +109,9 @@ pub fn view(tile: &Tile, wid: window::Id) -> Element<'_, Message> { emoji_page( tile.config.theme.clone(), tile.emoji_apps - .search_prefix(&tile.query_lc) - .map(|x| x.to_owned()) + .search(&tile.query) + .into_iter() + .map(|(_, app)| app.clone()) .collect(), tile.focus_id, ) diff --git a/src/app/tile/update.rs b/src/app/tile/update.rs index a7f75a6..1e54dd0 100644 --- a/src/app/tile/update.rs +++ b/src/app/tile/update.rs @@ -1,8 +1,8 @@ //! This handles the update logic for the tile (AKA rustcast's main window) -use std::cmp::min; use std::fs; use std::path::Path; use std::thread; +use std::{borrow::Cow, cmp::min}; use iced::Task; use iced::widget::image::Handle; @@ -56,11 +56,11 @@ pub fn handle_update(tile: &mut Tile, message: Message) -> Task { } Message::EscKeyPressed(id) => { - if tile.page == Page::EmojiSearch && !tile.query_lc.is_empty() { + if tile.page == Page::EmojiSearch && !tile.query.is_empty() { return Task::none(); } - if tile.query_lc.is_empty() { + if tile.query.is_empty() { Task::batch([ Task::done(Message::HideWindow(id)), Task::done(Message::ReturnFocus), @@ -83,7 +83,6 @@ pub fn handle_update(tile: &mut Tile, message: Message) -> Task { } Message::ClearSearchQuery => { - tile.query_lc = String::new(); tile.query = String::new(); Task::none() } @@ -91,7 +90,7 @@ pub fn handle_update(tile: &mut Tile, message: Message) -> Task { Message::ChangeFocus(key) => { let len = match tile.page { Page::ClipboardHistory => tile.clipboard_content.len() as u32, - Page::EmojiSearch => tile.emoji_apps.search_prefix(&tile.query_lc).count() as u32, // or tile.results.len() + Page::EmojiSearch => tile.emoji_apps.search(&tile.query).len() as u32, _ => tile.results.len() as u32, }; @@ -268,11 +267,9 @@ pub fn handle_update(tile: &mut Tile, message: Message) -> Task { match update_query_char { Move::Forwards(query_char) => { tile.query += &query_char.clone(); - tile.query_lc += &query_char.clone().to_lowercase(); } Move::Back => { tile.query.pop(); - tile.query_lc.pop(); } } let updated_query = tile.query.clone(); @@ -309,10 +306,9 @@ pub fn handle_update(tile: &mut Tile, message: Message) -> Task { perform_haptic(HapticPattern::Alignment); } - tile.query_lc = input.trim().to_lowercase(); tile.query = input; let prev_size = tile.results.len(); - if tile.query_lc.is_empty() && tile.page != Page::ClipboardHistory { + if tile.query.is_empty() && tile.page != Page::ClipboardHistory { tile.results = vec![]; return window::resize( id, @@ -321,14 +317,13 @@ pub fn handle_update(tile: &mut Tile, message: Message) -> Task { height: DEFAULT_WINDOW_HEIGHT, }, ); - } else if tile.query_lc == "randomvar" { + } else if tile.query.eq_ignore_ascii_case("randomvar") { let rand_num = rand::random_range(0..100); tile.results = vec![App { open_command: AppCommand::Function(Function::RandomVar(rand_num)), - desc: "Easter egg".to_string(), + desc: Cow::Borrowed("Easter egg"), icons: None, - name: rand_num.to_string(), - name_lc: String::new(), + name: Cow::Owned(rand_num.to_string()), }]; return window::resize( id, @@ -337,13 +332,12 @@ pub fn handle_update(tile: &mut Tile, message: Message) -> Task { height: 55. + DEFAULT_WINDOW_HEIGHT, }, ); - } else if tile.query_lc == "67" { + } else if tile.query.eq_ignore_ascii_case("67") { tile.results = vec![App { open_command: AppCommand::Function(Function::RandomVar(67)), - desc: "Easter egg".to_string(), + desc: Cow::Borrowed("Easter egg"), icons: None, - name: 67.to_string(), - name_lc: String::new(), + name: Cow::Borrowed("67"), }]; return window::resize( id, @@ -352,34 +346,35 @@ pub fn handle_update(tile: &mut Tile, message: Message) -> Task { height: 55. + DEFAULT_WINDOW_HEIGHT, }, ); - } else if tile.query_lc.ends_with("?") { + } else if tile.query.ends_with("?") { tile.results = vec![App { open_command: AppCommand::Function(Function::GoogleSearch(tile.query.clone())), icons: None, - desc: "Web Search".to_string(), - name: format!("Search for: {}", tile.query), - name_lc: String::new(), + desc: Cow::Borrowed("Web Search"), + name: Cow::Owned(format!("Search for: {}", tile.query)), }]; return window::resize( id, iced::Size::new(WINDOW_WIDTH, 55. + DEFAULT_WINDOW_HEIGHT), ); - } else if tile.query_lc == "cbhist" { + } else if tile.query.eq_ignore_ascii_case("cbhist") { tile.page = Page::ClipboardHistory - } else if tile.query_lc == "main" { + } else if tile.query.eq_ignore_ascii_case("main") { tile.page = Page::Main } tile.handle_search_query_changed(); if tile.results.is_empty() - && let Some(res) = Expr::from_str(&tile.query).ok() + && let Some(expr) = Expr::from_str(&tile.query).ok() { tile.results.push(App { - open_command: AppCommand::Function(Function::Calculate(res.clone())), - desc: RUSTCAST_DESC_NAME.to_string(), + open_command: AppCommand::Function(Function::Calculate(expr.clone())), + desc: Cow::Borrowed(RUSTCAST_DESC_NAME), icons: None, - name: res.eval().map(|x| x.to_string()).unwrap_or("".to_string()), - name_lc: "".to_string(), + name: expr + .eval() + .map(|result| Cow::Owned(result.to_string())) + .unwrap_or(Cow::Borrowed("")), }); } else if tile.results.is_empty() && let Some(conversions) = unit_conversion::convert_query(&tile.query) @@ -399,47 +394,44 @@ pub fn handle_update(tile: &mut Tile, message: Message) -> Task { ); App { open_command: AppCommand::Function(Function::CopyToClipboard( - ClipBoardContentType::Text(target.clone()), + ClipBoardContentType::Text(Cow::Owned(target.clone())), )), - desc: source, + desc: Cow::Owned(source), icons: None, - name: target, - name_lc: String::new(), + name: Cow::Owned(target), } }) .collect(); } else if tile.results.is_empty() && is_valid_url(&tile.query) { tile.results.push(App { open_command: AppCommand::Function(Function::OpenWebsite(tile.query.clone())), - desc: "Web Browsing".to_string(), + desc: Cow::Borrowed("Web Browsing"), icons: None, - name: "Open Website: ".to_string() + &tile.query, - name_lc: "".to_string(), + name: Cow::Owned(format!("Open Website: {}", tile.query)), }); - } else if tile.query_lc.split(' ').count() > 1 { + } else if tile.query.split_whitespace().count() > 1 { tile.results.push(App { open_command: AppCommand::Function(Function::GoogleSearch(tile.query.clone())), icons: None, - desc: "Web Search".to_string(), - name: format!("Search for: {}", tile.query), - name_lc: String::new(), + desc: Cow::Borrowed("Web Search"), + name: Cow::Owned(format!("Search for: {}", tile.query)), }); - } else if tile.results.is_empty() && tile.query_lc == "lemon" { + } else if tile.results.is_empty() && tile.query.eq_ignore_ascii_case("lemon") { tile.results.push(App { open_command: AppCommand::Display, - desc: "Easter Egg".to_string(), + desc: Cow::Borrowed("Easter Egg"), icons: Some(Handle::from_path(Path::new( "/Applications/Rustcast.app/Contents/Resources/lemon.png", ))), - name: "Lemon".to_string(), - name_lc: "".to_string(), + name: Cow::Borrowed("Lemon"), }); } - if !tile.query_lc.is_empty() && tile.page == Page::EmojiSearch { + if !tile.query.is_empty() && tile.page == Page::EmojiSearch { tile.results = tile .emoji_apps - .search_prefix("") - .map(|x| x.to_owned()) + .search("") + .into_iter() + .map(|(_, app)| app.clone()) .collect(); } diff --git a/src/clipboard.rs b/src/clipboard.rs index 979432e..ddfa3f5 100644 --- a/src/clipboard.rs +++ b/src/clipboard.rs @@ -1,4 +1,6 @@ //! This has all the logic regarding the cliboard history +use std::borrow::Cow; + use arboard::ImageData; use crate::{app::apps::App, commands::Function}; @@ -6,7 +8,7 @@ use crate::{app::apps::App, commands::Function}; /// The kinds of clipboard content that rustcast can handle and their contents #[derive(Debug, Clone)] pub enum ClipBoardContentType { - Text(String), + Text(Cow<'static, str>), Image(ImageData<'static>), } @@ -14,24 +16,23 @@ impl ClipBoardContentType { /// Returns the iced element for rendering the clipboard item, and the entire content since the /// display name is only the first line pub fn to_app(&self) -> App { - let mut name = match self { - ClipBoardContentType::Image(_) => "".to_string(), - ClipBoardContentType::Text(a) => a.to_owned(), + let name = match self { + ClipBoardContentType::Image(_) => Cow::Borrowed(""), + ClipBoardContentType::Text(text) => text.clone(), }; - let self_clone = self.clone(); - let name_lc = name.clone(); + let this = self.clone(); // only get the first line from the contents - name = name.lines().next().unwrap_or("").to_string(); + let name = name + .lines() + .next() + .map_or_else(|| Cow::Borrowed(""), |line| Cow::Owned(line.to_owned())); App { - open_command: crate::app::apps::AppCommand::Function(Function::CopyToClipboard( - self_clone.to_owned(), - )), - desc: "Clipboard Item".to_string(), + open_command: crate::app::apps::AppCommand::Function(Function::CopyToClipboard(this)), + desc: Cow::Borrowed("Clipboard Item"), icons: None, - name_lc, name, } } diff --git a/src/commands.rs b/src/commands.rs index bfffee1..113605d 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -92,7 +92,7 @@ impl Function { Function::CopyToClipboard(clipboard_content) => match clipboard_content { ClipBoardContentType::Text(text) => { - Clipboard::new().unwrap().set_text(text).ok(); + Clipboard::new().unwrap().set_text(text.as_ref()).ok(); } ClipBoardContentType::Image(img) => { Clipboard::new().unwrap().set_image(img.to_owned_img()).ok(); diff --git a/src/config.rs b/src/config.rs index c25f5b6..9f04d9e 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1,5 +1,5 @@ //! This is the config file type definitions for rustcast -use std::{path::Path, sync::Arc}; +use std::{borrow::Cow, path::Path, sync::Arc}; use iced::{Font, font::Family, theme::Custom, widget::image::Handle}; use serde::{Deserialize, Serialize}; @@ -168,14 +168,13 @@ pub struct Shelly { command: String, icon_path: Option, alias: String, - alias_lc: String, } impl Shelly { /// Converts the shelly struct to an app so that it can be added to the app list pub fn to_app(&self) -> App { - let self_clone = self.clone(); - let icon = self_clone.icon_path.and_then(|x| { + let this = self.clone(); + let icon = this.icon_path.and_then(|x| { let x = x.replace("~", &std::env::var("HOME").unwrap()); if x.ends_with(".icns") { handle_from_icns(Path::new(&x)) @@ -183,15 +182,15 @@ impl Shelly { Some(Handle::from_path(Path::new(&x))) } }); + App { open_command: AppCommand::Function(Function::RunShellCommand( - self_clone.command, - self_clone.alias_lc.clone(), + this.command, + this.alias.clone(), )), - desc: "Shell Command".to_string(), + desc: Cow::Borrowed("Shell Command"), icons: icon, - name: self_clone.alias, - name_lc: self_clone.alias_lc, + name: Cow::Owned(this.alias), } } } diff --git a/src/platform/cross.rs b/src/platform/cross.rs index 3f0afe2..2bd250f 100644 --- a/src/platform/cross.rs +++ b/src/platform/cross.rs @@ -1,4 +1,5 @@ use std::{ + borrow::Cow, fs, path::{Path, PathBuf}, process::exit, @@ -142,10 +143,9 @@ fn discover_apps( let name = file_name.strip_suffix(".app").unwrap().to_string(); Some(App { open_command: AppCommand::Function(Function::OpenApp(path_str)), - desc: "Application".to_string(), + desc: Cow::Borrowed("Application"), icons, - name_lc: name.to_lowercase(), - name, + name: Cow::Owned(name), }) }) } diff --git a/src/platform/macos/discovery.rs b/src/platform/macos/discovery.rs index 7e4a1fd..8746d8c 100644 --- a/src/platform/macos/discovery.rs +++ b/src/platform/macos/discovery.rs @@ -15,6 +15,7 @@ use core::{ ptr::{self, NonNull}, }; use std::{ + borrow::Cow, env, path::{Path, PathBuf}, sync::LazyLock, @@ -250,9 +251,8 @@ fn query_app(url: impl AsRef, store_icons: bool) -> Option { .flatten(); Some(App { - name: name.clone(), - name_lc: name.to_lowercase(), - desc: "Application".to_string(), + name: Cow::Owned(name), + desc: Cow::Borrowed("Application"), icons, open_command: AppCommand::Function(Function::OpenApp(path.to_string_lossy().into_owned())), })