diff --git a/Cargo.lock b/Cargo.lock index 8740c7b..57bd30b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -32,12 +32,6 @@ version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - [[package]] name = "android_system_properties" version = "0.1.5" @@ -99,9 +93,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.99" +version = "1.0.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0674a1ddeecb70197781e945de4b3b8ffb61fa939a5597bcf48503737663100" +checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61" [[package]] name = "async-broadcast" @@ -143,20 +137,20 @@ dependencies = [ [[package]] name = "async-io" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19634d6336019ef220f09fd31168ce5c184b295cbf80345437cc36094ef223ca" +checksum = "456b8a8feb6f42d237746d4b3e9a178494627745c3c56c6ea55d92ba50d026fc" dependencies = [ - "async-lock", + "autocfg", "cfg-if", "concurrent-queue", "futures-io", "futures-lite", "parking", "polling", - "rustix 1.0.8", + "rustix 1.1.2", "slab", - "windows-sys 0.60.2", + "windows-sys 0.61.0", ] [[package]] @@ -172,9 +166,9 @@ dependencies = [ [[package]] name = "async-process" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65daa13722ad51e6ab1a1b9c01299142bc75135b337923cfa10e79bbbd669f00" +checksum = "fc50921ec0055cdd8a16de48773bfeec5c972598674347252c0399676be7da75" dependencies = [ "async-channel", "async-io", @@ -185,7 +179,7 @@ dependencies = [ "cfg-if", "event-listener", "futures-lite", - "rustix 1.0.8", + "rustix 1.1.2", ] [[package]] @@ -201,9 +195,9 @@ dependencies = [ [[package]] name = "async-signal" -version = "0.2.12" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f567af260ef69e1d52c2b560ce0ea230763e6fbb9214a85d768760a920e3e3c1" +checksum = "43c070bbf59cd3570b6b2dd54cd772527c7c3620fce8be898406dd3ed6adc64c" dependencies = [ "async-io", "async-lock", @@ -211,10 +205,10 @@ dependencies = [ "cfg-if", "futures-core", "futures-io", - "rustix 1.0.8", + "rustix 1.1.2", "signal-hook-registry", "slab", - "windows-sys 0.60.2", + "windows-sys 0.61.0", ] [[package]] @@ -299,9 +293,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.9.3" +version = "2.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34efbcccd345379ca2868b2b2c9d3782e9cc58ba87bc7d79d5b53d9c9ae6f25d" +checksum = "2261d10cca569e4643e526d8dc2e62e433cc8aba21ab764233731f8d369bf394" [[package]] name = "block-buffer" @@ -360,10 +354,11 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.34" +version = "1.2.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42bc4aea80032b7bf409b0bc7ccad88853858911b7713a8062fdc0623867bedc" +checksum = "80f41ae168f955c12fb8960b057d70d0ca153fb83182b57d86380443527be7e9" dependencies = [ + "find-msvc-tools", "shlex", ] @@ -381,23 +376,22 @@ checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" [[package]] name = "chrono" -version = "0.4.41" +version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c469d952047f47f91b68d1cba3f10d63c11d73e4636f24f08daf0278abf01c4d" +checksum = "145052bdd345b87320e369255277e3fb5152762ad123a901ef5c262dd38fe8d2" dependencies = [ - "android-tzdata", "iana-time-zone", "js-sys", "num-traits", "wasm-bindgen", - "windows-link", + "windows-link 0.2.0", ] [[package]] name = "clap" -version = "4.5.46" +version = "4.5.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c5e4fcf9c21d2e544ca1ee9d8552de13019a42aa7dbf32747fa7aaf1df76e57" +checksum = "e2134bb3ea021b78629caa971416385309e0131b351b25e01dc16fb54e1b5fae" dependencies = [ "clap_builder", "clap_derive", @@ -405,9 +399,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.46" +version = "4.5.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fecb53a0e6fcfb055f686001bc2e2592fa527efaf38dbe81a6a9563562e57d41" +checksum = "c2ba64afa3c0a6df7fa517765e31314e983f51dda798ffba27b988194fb65dc9" dependencies = [ "anstream", "anstyle", @@ -417,9 +411,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.45" +version = "4.5.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14cb31bb0a7d536caef2639baa7fad459e15c3144efefa6dbd1c84562c4739f6" +checksum = "bbfd7eae0b0f1a6e63d4b13c9c478de77c2eb546fba158ad50b4203dc24b9f9c" dependencies = [ "heck", "proc-macro2", @@ -518,7 +512,7 @@ version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "829d955a0bb380ef178a640b91779e3987da38c9aea133b20614cfed8cdea9c6" dependencies = [ - "bitflags 2.9.3", + "bitflags 2.9.4", "crossterm_winapi", "mio", "parking_lot", @@ -534,14 +528,14 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d8b9f2e4c67f833b660cdb0a3523065869fb35570177239812ed4c905aeff87b" dependencies = [ - "bitflags 2.9.3", + "bitflags 2.9.4", "crossterm_winapi", "derive_more", "document-features", "futures-core", "mio", "parking_lot", - "rustix 1.0.8", + "rustix 1.1.2", "signal-hook", "signal-hook-mio", "winapi", @@ -619,9 +613,9 @@ checksum = "5729f5117e208430e437df2f4843f5e5952997175992d1414f94c57d61e270b4" [[package]] name = "deranged" -version = "0.4.0" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e" +checksum = "a41953f86f8a05768a6cda24def994fd2f424b04ec5c719cf89989779f199071" dependencies = [ "powerfmt", ] @@ -675,7 +669,7 @@ dependencies = [ "libc", "option-ext", "redox_users", - "windows-sys 0.60.2", + "windows-sys 0.61.0", ] [[package]] @@ -751,12 +745,12 @@ checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "errno" -version = "0.3.13" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "778e2ac28f6c47af28e4907f13ffd1e1ddbd400980a9abd7c8df189bf578a5ad" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.60.2", + "windows-sys 0.61.0", ] [[package]] @@ -816,6 +810,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "find-msvc-tools" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ced73b1dacfc750a6db6c0a0c3a3853c8b41997e2e2c563dc90804ae6867959" + [[package]] name = "finl_unicode" version = "1.3.0" @@ -840,6 +840,12 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" +[[package]] +name = "foldhash" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" + [[package]] name = "futures" version = "0.3.31" @@ -972,7 +978,7 @@ dependencies = [ "cfg-if", "libc", "r-efi", - "wasi 0.14.2+wasi-0.2.4", + "wasi 0.14.7+wasi-0.2.4", ] [[package]] @@ -989,7 +995,18 @@ checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" dependencies = [ "allocator-api2", "equivalent", - "foldhash", + "foldhash 0.1.5", +] + +[[package]] +name = "hashbrown" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5419bdc4f6a9207fbeba6d11b604d481addf78ecd10c11ad51e76c2f6482748d" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash 0.2.0", ] [[package]] @@ -1012,9 +1029,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "iana-time-zone" -version = "0.1.63" +version = "0.1.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0c919e5debc312ad217002b8048a17b7d83f80703865bbfcfebb0458b0b27d8" +checksum = "33e57f83510bb73707521ebaffa789ec8caf86f9657cad665b092b581d40e9fb" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -1064,12 +1081,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.11.0" +version = "2.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2481980430f9f78649238835720ddccc57e52df14ffce1c6f37391d61b563e9" +checksum = "4b0f83760fb341a774ed326568e19f5a863af4a952def8c39f9ab92fd95b88e5" dependencies = [ "equivalent", - "hashbrown", + "hashbrown 0.16.0", ] [[package]] @@ -1097,7 +1114,7 @@ version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "046fa2d4d00aea763528b4950358d0ead425372445dc8ff86312b3c69ff7727b" dependencies = [ - "bitflags 2.9.3", + "bitflags 2.9.4", "cfg-if", "libc", ] @@ -1170,9 +1187,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.77" +version = "0.3.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +checksum = "ec48937a97411dcb524a265206ccd4c90bb711fca92b2792c407f268825b9305" dependencies = [ "once_cell", "wasm-bindgen", @@ -1180,11 +1197,12 @@ dependencies = [ [[package]] name = "kasuari" -version = "0.4.7" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d9e0d6a8bf886abccc1cbcac7d74f9000ae5882aedc4a9042188bbc9cd4487" +checksum = "12a3d6645acdef96d256c1f9fd3be7ecfa60d8457520a50bbd1600b6053f8173" dependencies = [ - "hashbrown", + "hashbrown 0.16.0", + "portable-atomic", "thiserror 2.0.16", ] @@ -1202,17 +1220,17 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.175" +version = "0.2.176" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a82ae493e598baaea5209805c49bbf2ea7de956d50d7da0da1164f9c6d28543" +checksum = "58f929b4d672ea937a23a1ab494143d968337a5f47e56d0815df1e0890ddf174" [[package]] name = "libredox" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "391290121bad3d37fbddad76d8f5d1c1c314cfc646d143d7e07a3086ddff0ce3" +checksum = "416f7e718bdb06000964960ffa43b4335ad4012ae8b99060261aa4a8088d5ccb" dependencies = [ - "bitflags 2.9.3", + "bitflags 2.9.4", "libc", ] @@ -1222,7 +1240,7 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51a1679740111eb63b7b4cb3c97b1d5d9f82e142292a25edcfdb4120a48b3880" dependencies = [ - "bitflags 2.9.3", + "bitflags 2.9.4", ] [[package]] @@ -1233,9 +1251,9 @@ checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" [[package]] name = "linux-raw-sys" -version = "0.9.4" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" +checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039" [[package]] name = "litrs" @@ -1255,9 +1273,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.27" +version = "0.4.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" +checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432" [[package]] name = "lru" @@ -1265,7 +1283,7 @@ version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" dependencies = [ - "hashbrown", + "hashbrown 0.15.5", ] [[package]] @@ -1274,7 +1292,7 @@ version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9f8cc7106155f10bdf99a6f379688f543ad6596a415375b36a59a054ceda1198" dependencies = [ - "hashbrown", + "hashbrown 0.15.5", ] [[package]] @@ -1289,9 +1307,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.7.5" +version = "2.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" +checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" [[package]] name = "memmem" @@ -1341,7 +1359,7 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" dependencies = [ - "bitflags 2.9.3", + "bitflags 2.9.4", "cfg-if", "cfg_aliases", "libc", @@ -1354,7 +1372,7 @@ version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "74523f3a35e05aba87a1d978330aef40f67b0304ac79c1c00b294c9830543db6" dependencies = [ - "bitflags 2.9.3", + "bitflags 2.9.4", "cfg-if", "cfg_aliases", "libc", @@ -1489,9 +1507,9 @@ checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "pest" -version = "2.8.1" +version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1db05f56d34358a8b1066f67cbb203ee3e7ed2ba674a6263a1d5ec6db2204323" +checksum = "21e0a3a33733faeaf8651dfee72dd0f388f0c8e5ad496a3478fa5a922f49cfa8" dependencies = [ "memchr", "thiserror 2.0.16", @@ -1500,9 +1518,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.8.1" +version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb056d9e8ea77922845ec74a1c4e8fb17e7c218cc4fc11a15c5d25e189aa40bc" +checksum = "bc58706f770acb1dbd0973e6530a3cff4746fb721207feb3a8a6064cd0b6c663" dependencies = [ "pest", "pest_generator", @@ -1510,9 +1528,9 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.8.1" +version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87e404e638f781eb3202dc82db6760c8ae8a1eeef7fb3fa8264b2ef280504966" +checksum = "6d4f36811dfe07f7b8573462465d5cb8965fffc2e71ae377a33aecf14c2c9a2f" dependencies = [ "pest", "pest_meta", @@ -1523,9 +1541,9 @@ dependencies = [ [[package]] name = "pest_meta" -version = "2.8.1" +version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edd1101f170f5903fde0914f899bb503d9ff5271d7ba76bbb70bea63690cc0d5" +checksum = "42919b05089acbd0a5dcd5405fb304d17d1053847b81163d09c4ad18ce8e8420" dependencies = [ "pest", "sha2", @@ -1608,16 +1626,16 @@ dependencies = [ [[package]] name = "polling" -version = "3.10.0" +version = "3.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5bd19146350fe804f7cb2669c851c03d69da628803dab0d98018142aaa5d829" +checksum = "5d0e4f59085d47d8241c88ead0f274e8a0cb551f3625263c05eb8dd897c34218" dependencies = [ "cfg-if", "concurrent-queue", "hermit-abi", "pin-project-lite", - "rustix 1.0.8", - "windows-sys 0.60.2", + "rustix 1.1.2", + "windows-sys 0.61.0", ] [[package]] @@ -1643,9 +1661,9 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "proc-macro-crate" -version = "3.3.0" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edce586971a4dfaa28950c6f18ed55e0406c1ab88bbce2c6f6293a7aaba73d35" +checksum = "219cb19e96be00ab2e37d6e299658a0cfa83e52429179969b0f0121b4ac46983" dependencies = [ "toml_edit", ] @@ -1695,7 +1713,7 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eabd94c2f37801c20583fc49dd5cd6b0ba68c716787c2dd6ed18571e1e63117b" dependencies = [ - "bitflags 2.9.3", + "bitflags 2.9.4", "cassowary", "compact_str 0.8.1", "crossterm 0.28.1", @@ -1730,9 +1748,9 @@ version = "0.1.0-alpha.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f836b2eac888da74162b680a8facdbe784ae73df3b0f711eef74bb90a7477f78" dependencies = [ - "bitflags 2.9.3", + "bitflags 2.9.4", "compact_str 0.9.0", - "hashbrown", + "hashbrown 0.15.5", "indoc", "itertools 0.14.0", "kasuari", @@ -1781,8 +1799,8 @@ version = "0.3.0-alpha.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "388428527811be6da3e23157d951308d9eae4ce1b4d1d545a55673bbcdfb7326" dependencies = [ - "bitflags 2.9.3", - "hashbrown", + "bitflags 2.9.4", + "hashbrown 0.15.5", "indoc", "instability", "itertools 0.14.0", @@ -1800,7 +1818,7 @@ version = "0.5.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5407465600fb0548f1442edf71dd20683c6ed326200ace4b1ef0763521bb3b77" dependencies = [ - "bitflags 2.9.3", + "bitflags 2.9.4", ] [[package]] @@ -1816,9 +1834,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.11.2" +version = "1.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23d7fd106d8c02486a8d64e778353d1cffe08ce79ac2e82f540c86d0facf6912" +checksum = "8b5288124840bee7b386bc413c487869b360b2b4ec421ea56425128692f2a82c" dependencies = [ "aho-corasick", "memchr", @@ -1828,9 +1846,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.10" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b9458fa0bfeeac22b5ca447c63aaf45f28439a709ccd244698632f9aa6394d6" +checksum = "833eb9ce86d40ef33cb1306d8accf7bc8ec2bfea4355cbdebb3df68b40925cad" dependencies = [ "aho-corasick", "memchr", @@ -1855,7 +1873,7 @@ version = "0.38.44" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" dependencies = [ - "bitflags 2.9.3", + "bitflags 2.9.4", "errno", "libc", "linux-raw-sys 0.4.15", @@ -1864,15 +1882,15 @@ dependencies = [ [[package]] name = "rustix" -version = "1.0.8" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11181fbabf243db407ef8df94a6ce0b2f9a733bd8be4ad02b4eda9602296cac8" +checksum = "cd15f8a2c5551a84d56efdc1cd049089e409ac19a3072d5037a17fd70719ff3e" dependencies = [ - "bitflags 2.9.3", + "bitflags 2.9.4", "errno", "libc", - "linux-raw-sys 0.9.4", - "windows-sys 0.60.2", + "linux-raw-sys 0.11.0", + "windows-sys 0.61.0", ] [[package]] @@ -1895,18 +1913,28 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "serde" -version = "1.0.219" +version = "1.0.226" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +checksum = "0dca6411025b24b60bfa7ec1fe1f8e710ac09782dca409ee8237ba74b51295fd" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.226" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba2ba63999edb9dac981fb34b3e5c0d111a69b0924e253ed29d83f7c99e966a4" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.219" +version = "1.0.226" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +checksum = "8db53ae22f34573731bafa1db20f04027b2d25e02d8205921b569171699cdb33" dependencies = [ "proc-macro2", "quote", @@ -1926,11 +1954,11 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40734c41988f7306bb04f0ecf60ec0f3f1caa34290e4e8ea471dcd3346483b83" +checksum = "5417783452c2be558477e104686f7de5dae53dba813c28435e0e70f82d9b04ee" dependencies = [ - "serde", + "serde_core", ] [[package]] @@ -2087,15 +2115,15 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.21.0" +version = "3.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15b61f8f20e3a6f7e0649d825294eaf317edce30f82cf6026e7e4cb9222a7d1e" +checksum = "2d31c77bdf42a745371d260a26ca7163f1e0924b64afa0b688e61b5a9fa02f16" dependencies = [ "fastrand", "getrandom 0.3.3", "once_cell", - "rustix 1.0.8", - "windows-sys 0.60.2", + "rustix 1.1.2", + "windows-sys 0.61.0", ] [[package]] @@ -2139,7 +2167,7 @@ checksum = "4676b37242ccbd1aabf56edb093a4827dc49086c0ffd764a5705899e0f35f8f7" dependencies = [ "anyhow", "base64", - "bitflags 2.9.3", + "bitflags 2.9.4", "fancy-regex", "filedescriptor", "finl_unicode", @@ -2215,9 +2243,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.41" +version = "0.3.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a7619e19bc266e0f9c5e6686659d394bc57973859340060a69221e57dbc0c40" +checksum = "91e7d9e3bb61134e77bde20dd4825b97c010155709965fedf0f49bb138e52a9d" dependencies = [ "deranged", "libc", @@ -2230,9 +2258,9 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.4" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c" +checksum = "40868e7c1d2f0b8d73e4a8c7f0ff63af4f6d19be117e90bd73eb1d62cf831c6b" [[package]] name = "tokio" @@ -2267,14 +2295,14 @@ dependencies = [ [[package]] name = "toml" -version = "0.9.5" +version = "0.9.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75129e1dc5000bfbaa9fee9d1b21f974f9fbad9daec557a521ee6e080825f6e8" +checksum = "00e5e5d9bf2475ac9d4f0d9edab68cc573dc2fd644b0dba36b0c30a92dd9eaa0" dependencies = [ "indexmap", - "serde", + "serde_core", "serde_spanned", - "toml_datetime 0.7.0", + "toml_datetime", "toml_parser", "toml_writer", "winnow", @@ -2282,44 +2310,39 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c" - -[[package]] -name = "toml_datetime" -version = "0.7.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bade1c3e902f58d73d3f294cd7f20391c1cb2fbcb643b73566bc773971df91e3" +checksum = "32f1085dec27c2b6632b04c80b3bb1b4300d6495d1e129693bdda7d91e72eec1" dependencies = [ - "serde", + "serde_core", ] [[package]] name = "toml_edit" -version = "0.22.27" +version = "0.23.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" +checksum = "f3effe7c0e86fdff4f69cdd2ccc1b96f933e24811c5441d44904e8683e27184b" dependencies = [ "indexmap", - "toml_datetime 0.6.11", + "toml_datetime", + "toml_parser", "winnow", ] [[package]] name = "toml_parser" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b551886f449aa90d4fe2bdaa9f4a2577ad2dde302c61ecf262d80b116db95c10" +checksum = "4cf893c33be71572e0e9aa6dd15e6677937abd686b066eac3f8cd3531688a627" dependencies = [ "winnow", ] [[package]] name = "toml_writer" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc842091f2def52017664b53082ecbbeb5c7731092bad69d2c63050401dfd64" +checksum = "d163a63c116ce562a22cda521fcc4d79152e7aba014456fb5eb442f6d6a10109" [[package]] name = "tracing" @@ -2387,9 +2410,9 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.18" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" +checksum = "f63a545481291138910575129486daeaf8ac54aee4387fe7906919f7830c7d9d" [[package]] name = "unicode-segmentation" @@ -2439,9 +2462,9 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.18.0" +version = "1.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f33196643e165781c20a5ead5582283a7dacbb87855d867fbc2df3f81eddc1be" +checksum = "2f87b8aa10b915a06587d0dec516c282ff295b475d94abf425d62b57710070a2" dependencies = [ "atomic", "getrandom 0.3.3", @@ -2472,30 +2495,40 @@ checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" [[package]] name = "wasi" -version = "0.14.2+wasi-0.2.4" +version = "0.14.7+wasi-0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" +checksum = "883478de20367e224c0090af9cf5f9fa85bed63a95c1abf3afc5c083ebc06e8c" dependencies = [ - "wit-bindgen-rt", + "wasip2", +] + +[[package]] +name = "wasip2" +version = "1.0.1+wasi-0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0562428422c63773dad2c345a1882263bbf4d65cf3f42e90921f787ef5ad58e7" +dependencies = [ + "wit-bindgen", ] [[package]] name = "wasm-bindgen" -version = "0.2.100" +version = "0.2.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" +checksum = "c1da10c01ae9f1ae40cbfac0bac3b1e724b320abfcf52229f80b547c0d250e2d" dependencies = [ "cfg-if", "once_cell", "rustversion", "wasm-bindgen-macro", + "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.100" +version = "0.2.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" +checksum = "671c9a5a66f49d8a47345ab942e2cb93c7d1d0339065d4f8139c486121b43b19" dependencies = [ "bumpalo", "log", @@ -2507,9 +2540,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.100" +version = "0.2.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" +checksum = "7ca60477e4c59f5f2986c50191cd972e3a50d8a95603bc9434501cf156a9a119" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2517,9 +2550,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.100" +version = "0.2.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" +checksum = "9f07d2f20d4da7b26400c9f4a0511e6e0345b040694e8a75bd41d578fa4421d7" dependencies = [ "proc-macro2", "quote", @@ -2530,9 +2563,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.100" +version = "0.2.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +checksum = "bad67dc8b2a1a6e5448428adec4c3e84c43e561d8c9ee8a9e5aabeb193ec41d1" dependencies = [ "unicode-ident", ] @@ -2633,13 +2666,13 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows-core" -version = "0.61.2" +version = "0.62.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" +checksum = "57fe7168f7de578d2d8a05b07fd61870d2e73b4020e9f49aa00da8471723497c" dependencies = [ "windows-implement", "windows-interface", - "windows-link", + "windows-link 0.2.0", "windows-result", "windows-strings", ] @@ -2672,22 +2705,28 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" +[[package]] +name = "windows-link" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45e46c0661abb7180e7b9c281db115305d49ca1709ab8242adf09666d2173c65" + [[package]] name = "windows-result" -version = "0.3.4" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" +checksum = "7084dcc306f89883455a206237404d3eaf961e5bd7e0f312f7c91f57eb44167f" dependencies = [ - "windows-link", + "windows-link 0.2.0", ] [[package]] name = "windows-strings" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" +checksum = "7218c655a553b0bed4426cf54b20d7ba363ef543b52d515b3e48d7fd55318dda" dependencies = [ - "windows-link", + "windows-link 0.2.0", ] [[package]] @@ -2708,6 +2747,15 @@ dependencies = [ "windows-targets 0.53.3", ] +[[package]] +name = "windows-sys" +version = "0.61.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e201184e40b2ede64bc2ea34968b28e33622acdbbf37104f0e4a33f7abe657aa" +dependencies = [ + "windows-link 0.2.0", +] + [[package]] name = "windows-targets" version = "0.52.6" @@ -2730,7 +2778,7 @@ version = "0.53.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d5fe6031c4041849d7c496a8ded650796e7b6ecc19df1a431c1a363342e5dc91" dependencies = [ - "windows-link", + "windows-link 0.1.3", "windows_aarch64_gnullvm 0.53.0", "windows_aarch64_msvc 0.53.0", "windows_i686_gnu 0.53.0", @@ -2847,13 +2895,10 @@ dependencies = [ ] [[package]] -name = "wit-bindgen-rt" -version = "0.39.0" +name = "wit-bindgen" +version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" -dependencies = [ - "bitflags 2.9.3", -] +checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59" [[package]] name = "xterm-query" @@ -2867,9 +2912,9 @@ dependencies = [ [[package]] name = "zbus" -version = "5.10.0" +version = "5.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67a073be99ace1adc48af593701c8015cd9817df372e14a1a6b0ee8f8bf043be" +checksum = "2d07e46d035fb8e375b2ce63ba4e4ff90a7f73cf2ffb0138b29e1158d2eaadf7" dependencies = [ "async-broadcast", "async-executor", @@ -2900,9 +2945,9 @@ dependencies = [ [[package]] name = "zbus_macros" -version = "5.10.0" +version = "5.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e80cd713a45a49859dcb648053f63265f4f2851b6420d47a958e5697c68b131" +checksum = "57e797a9c847ed3ccc5b6254e8bcce056494b375b511b3d6edcec0aeb4defaca" dependencies = [ "proc-macro-crate", "proc-macro2", diff --git a/src/adapter.rs b/src/adapter.rs index 8f062e6..67eb6c0 100644 --- a/src/adapter.rs +++ b/src/adapter.rs @@ -89,21 +89,21 @@ impl Adapter { None => false, }; - let (device_block, access_point_block, connected_devices_block, help_block) = { + let (access_point_block, connected_devices_block, device_block, help_block) = { let chunks = Layout::default() .direction(Direction::Vertical) .constraints(if any_connected_devices { &[ - Constraint::Percentage(33), - Constraint::Percentage(33), - Constraint::Percentage(33), + Constraint::Length(5), + Constraint::Fill(1), + Constraint::Length(5), Constraint::Length(1), ] } else { &[ - Constraint::Percentage(50), - Constraint::Percentage(50), Constraint::Fill(1), + Constraint::Length(0), + Constraint::Length(5), Constraint::Length(1), ] }) @@ -480,127 +480,21 @@ impl Adapter { color_mode: ColorMode, focused_block: FocusedBlock, ) { - let (device_block, station_block, known_networks_block, new_networks_block, help_block) = { + let (known_networks_block, new_networks_block, device_block, help_block) = { let chunks = Layout::default() .direction(Direction::Vertical) .constraints([ - Constraint::Length(5), - Constraint::Length(5), Constraint::Min(5), Constraint::Min(5), + Constraint::Length(5), Constraint::Length(1), ]) .margin(1) .split(frame.area()); - (chunks[0], chunks[1], chunks[2], chunks[3], chunks[4]) + (chunks[0], chunks[1], chunks[2], chunks[3]) }; // Device - let row = Row::new(vec![ - Line::from(self.device.name.clone()).centered(), - Line::from("station").centered(), - { - if self.device.is_powered { - Line::from("On").centered() - } else { - Line::from("Off").centered() - } - }, - Line::from(self.device.address.clone()).centered(), - ]); - - let widths = [ - Constraint::Length(15), - Constraint::Length(8), - Constraint::Length(10), - Constraint::Length(17), - ]; - - let device_table = Table::new(vec![row], widths) - .header({ - if focused_block == FocusedBlock::Device { - Row::new(vec![ - Line::from("Name").yellow().centered(), - Line::from("Mode").yellow().centered(), - Line::from("Powered").yellow().centered(), - Line::from("Address").yellow().centered(), - ]) - .style(Style::new().bold()) - .bottom_margin(1) - } else { - Row::new(vec![ - Line::from("Name") - .style(match color_mode { - ColorMode::Dark => Style::default().fg(Color::White), - ColorMode::Light => Style::default().fg(Color::Black), - }) - .centered(), - Line::from("Mode") - .style(match color_mode { - ColorMode::Dark => Style::default().fg(Color::White), - ColorMode::Light => Style::default().fg(Color::Black), - }) - .centered(), - Line::from("Powered") - .style(match color_mode { - ColorMode::Dark => Style::default().fg(Color::White), - ColorMode::Light => Style::default().fg(Color::Black), - }) - .centered(), - Line::from("Address") - .style(match color_mode { - ColorMode::Dark => Style::default().fg(Color::White), - ColorMode::Light => Style::default().fg(Color::Black), - }) - .centered(), - ]) - .style(Style::new().bold()) - .bottom_margin(1) - } - }) - .block( - Block::default() - .title(" Device ") - .title_style({ - if focused_block == FocusedBlock::Device { - Style::default().bold() - } else { - Style::default() - } - }) - .borders(Borders::ALL) - .border_style({ - if focused_block == FocusedBlock::Device { - Style::default().fg(Color::Green) - } else { - Style::default() - } - }) - .border_type({ - if focused_block == FocusedBlock::Device { - BorderType::Thick - } else { - BorderType::default() - } - }) - .padding(Padding::horizontal(1)), - ) - .column_spacing(2) - .flex(Flex::SpaceBetween) - .style(match color_mode { - ColorMode::Dark => Style::default().fg(Color::White), - ColorMode::Light => Style::default().fg(Color::Black), - }) - .row_highlight_style(if focused_block == FocusedBlock::Device { - Style::default().bg(Color::DarkGray).fg(Color::White) - } else { - Style::default() - }); - - let mut device_state = TableState::default().with_selected(0); - frame.render_stateful_widget(device_table, device_block, &mut device_state); - - // Station let station_frequency = { match self.device.station.as_ref() { @@ -643,26 +537,40 @@ impl Adapter { station_state = station.state.clone(); station_is_scanning = station.is_scanning.clone().to_string(); } - let row = vec![ + + let row = Row::new(vec![ + Line::from(self.device.name.clone()).centered(), + Line::from("station").centered(), + { + if self.device.is_powered { + Line::from("On").centered() + } else { + Line::from("Off").centered() + } + }, Line::from(station_state).centered(), Line::from(station_is_scanning).centered(), Line::from(station_frequency).centered(), Line::from(station_security).centered(), - ]; - - let row = Row::new(row); + ]); let widths = [ + Constraint::Length(10), + Constraint::Length(8), + Constraint::Length(10), Constraint::Length(12), Constraint::Length(10), Constraint::Length(10), Constraint::Length(15), ]; - let station_table = Table::new(vec![row], widths) + let device_table = Table::new(vec![row], widths) .header({ - if focused_block == FocusedBlock::Station { + if focused_block == FocusedBlock::Device { Row::new(vec![ + Line::from("Name").yellow().centered(), + Line::from("Mode").yellow().centered(), + Line::from("Powered").yellow().centered(), Line::from("State").yellow().centered(), Line::from("Scanning").yellow().centered(), Line::from("Frequency").yellow().centered(), @@ -672,6 +580,24 @@ impl Adapter { .bottom_margin(1) } else { Row::new(vec![ + Line::from("Name") + .style(match color_mode { + ColorMode::Dark => Style::default().fg(Color::White), + ColorMode::Light => Style::default().fg(Color::Black), + }) + .centered(), + Line::from("Mode") + .style(match color_mode { + ColorMode::Dark => Style::default().fg(Color::White), + ColorMode::Light => Style::default().fg(Color::Black), + }) + .centered(), + Line::from("Powered") + .style(match color_mode { + ColorMode::Dark => Style::default().fg(Color::White), + ColorMode::Light => Style::default().fg(Color::Black), + }) + .centered(), Line::from("State") .style(match color_mode { ColorMode::Dark => Style::default().fg(Color::White), @@ -703,9 +629,9 @@ impl Adapter { }) .block( Block::default() - .title(" Station ") + .title(" Device ") .title_style({ - if focused_block == FocusedBlock::Station { + if focused_block == FocusedBlock::Device { Style::default().bold() } else { Style::default() @@ -713,14 +639,14 @@ impl Adapter { }) .borders(Borders::ALL) .border_style({ - if focused_block == FocusedBlock::Station { + if focused_block == FocusedBlock::Device { Style::default().fg(Color::Green) } else { Style::default() } }) .border_type({ - if focused_block == FocusedBlock::Station { + if focused_block == FocusedBlock::Device { BorderType::Thick } else { BorderType::default() @@ -728,20 +654,20 @@ impl Adapter { }) .padding(Padding::horizontal(1)), ) - .column_spacing(2) + .column_spacing(1) .flex(Flex::SpaceBetween) .style(match color_mode { ColorMode::Dark => Style::default().fg(Color::White), ColorMode::Light => Style::default().fg(Color::Black), }) - .row_highlight_style(if focused_block == FocusedBlock::Station { + .row_highlight_style(if focused_block == FocusedBlock::Device { Style::default().bg(Color::DarkGray).fg(Color::White) } else { Style::default() }); - let mut station_state = TableState::default().with_selected(0); - frame.render_stateful_widget(station_table, station_block, &mut station_state); + let mut device_state = TableState::default().with_selected(0); + frame.render_stateful_widget(device_table, device_block, &mut device_state); // Known networks let known_networks = if let Some(station) = self.device.station.as_ref() { @@ -1052,16 +978,6 @@ impl Adapter { Span::from("⇄").bold(), Span::from(" Nav"), ]), - FocusedBlock::Station => Line::from(vec![ - Span::from(self.config.station.start_scanning.to_string()).bold(), - Span::from(" Scan"), - Span::from(" | "), - Span::from("ctrl+r").bold(), - Span::from(" Switch Mode"), - Span::from(" | "), - Span::from("⇄").bold(), - Span::from(" Nav"), - ]), FocusedBlock::KnownNetworks => Line::from(vec![ Span::from("k,").bold(), Span::from(" Up"), @@ -1075,7 +991,7 @@ impl Adapter { self.config.station.toggle_connect.to_string() }) .bold(), - Span::from(" Connect/Disconnect"), + Span::from(" Dis/connect"), Span::from(" | "), Span::from(self.config.station.known_network.remove.to_string()).bold(), Span::from(" Remove"), @@ -1088,7 +1004,10 @@ impl Adapter { .to_string(), ) .bold(), - Span::from(" Toggle Autoconnect"), + Span::from(" Autoconnect"), + Span::from(" | "), + Span::from(self.config.station.start_scanning.to_string()).bold(), + Span::from(" Scan"), Span::from(" | "), Span::from("󱊷 ").bold(), Span::from(" Discard"), @@ -1109,6 +1028,9 @@ impl Adapter { Span::from("󱁐 ").bold(), Span::from(" Connect"), Span::from(" | "), + Span::from(self.config.station.start_scanning.to_string()).bold(), + Span::from(" Scan"), + Span::from(" | "), Span::from("󱊷 ").bold(), Span::from(" Discard"), Span::from(" | "), @@ -1135,7 +1057,7 @@ impl Adapter { .constraints([ Constraint::Fill(1), Constraint::Length(9), - Constraint::Fill(5), + Constraint::Fill(1), ]) .flex(Flex::Start) .split(frame.area()); diff --git a/src/app.rs b/src/app.rs index b752b5d..5bde095 100644 --- a/src/app.rs +++ b/src/app.rs @@ -25,7 +25,6 @@ pub type AppResult = std::result::Result>; #[derive(Debug, Clone, Copy, PartialEq)] pub enum FocusedBlock { Device, - Station, AccessPoint, KnownNetworks, NewNetworks, @@ -143,9 +142,14 @@ impl App { Ok(_) | Err(_) => ColorMode::Dark, }; + let focused_block = match current_mode { + Mode::Station => FocusedBlock::KnownNetworks, + _ => FocusedBlock::AccessPoint, + }; + Ok(Self { running: true, - focused_block: FocusedBlock::Device, + focused_block, color_mode, notifications: Vec::new(), session, diff --git a/src/device.rs b/src/device.rs index f35afdf..9faf059 100644 --- a/src/device.rs +++ b/src/device.rs @@ -5,7 +5,8 @@ use iwdrs::{device::Device as iwdDevice, modes::Mode, session::Session}; use tokio::sync::mpsc::UnboundedSender; use crate::{ - ap::AccessPoint, app::AppResult, event::Event, notification::Notification, station::Station, + app::AppResult, event::Event, mode::ap::AccessPoint, mode::station::Station, + notification::Notification, }; #[derive(Debug, Clone)] diff --git a/src/handler.rs b/src/handler.rs index fe440b9..731dfe8 100644 --- a/src/handler.rs +++ b/src/handler.rs @@ -1,9 +1,9 @@ use std::sync::Arc; -use crate::ap::APFocusedSection; use crate::app::{App, AppResult, FocusedBlock}; use crate::config::Config; use crate::event::Event; +use crate::mode::ap::APFocusedSection; use crate::notification::Notification; use crossterm::event::{KeyCode, KeyEvent, KeyModifiers}; @@ -161,9 +161,6 @@ pub async fn handle_key_events( KeyCode::Tab => match app.adapter.device.mode { Mode::Station => match app.focused_block { FocusedBlock::Device => { - app.focused_block = FocusedBlock::Station; - } - FocusedBlock::Station => { app.focused_block = FocusedBlock::KnownNetworks; } FocusedBlock::KnownNetworks => { @@ -212,11 +209,8 @@ pub async fn handle_key_events( FocusedBlock::Device => { app.focused_block = FocusedBlock::NewNetworks; } - FocusedBlock::Station => { - app.focused_block = FocusedBlock::Device; - } FocusedBlock::KnownNetworks => { - app.focused_block = FocusedBlock::Station; + app.focused_block = FocusedBlock::Device; } FocusedBlock::NewNetworks => { app.focused_block = FocusedBlock::KnownNetworks; diff --git a/src/lib.rs b/src/lib.rs index c5d2c0d..c708125 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -14,18 +14,10 @@ pub mod notification; pub mod device; -pub mod station; - -pub mod network; - -pub mod known_network; - -pub mod auth; - pub mod adapter; -pub mod ap; - pub mod cli; pub mod rfkill; + +pub mod mode; diff --git a/src/mode.rs b/src/mode.rs new file mode 100644 index 0000000..ec9b462 --- /dev/null +++ b/src/mode.rs @@ -0,0 +1,2 @@ +pub mod ap; +pub mod station; diff --git a/src/ap.rs b/src/mode/ap.rs similarity index 100% rename from src/ap.rs rename to src/mode/ap.rs diff --git a/src/station.rs b/src/mode/station.rs similarity index 99% rename from src/station.rs rename to src/mode/station.rs index 86d97e9..1db9058 100644 --- a/src/station.rs +++ b/src/mode/station.rs @@ -1,3 +1,7 @@ +pub mod auth; +pub mod known_network; +pub mod network; + use std::{collections::HashMap, sync::Arc}; use futures::future::join_all; @@ -8,10 +12,11 @@ use tokio::sync::mpsc::UnboundedSender; use crate::{ app::AppResult, event::Event, - network::Network, notification::{Notification, NotificationLevel}, }; +use network::Network; + #[derive(Debug, Clone)] pub struct Station { pub session: Arc, diff --git a/src/auth.rs b/src/mode/station/auth.rs similarity index 100% rename from src/auth.rs rename to src/mode/station/auth.rs diff --git a/src/known_network.rs b/src/mode/station/known_network.rs similarity index 100% rename from src/known_network.rs rename to src/mode/station/known_network.rs diff --git a/src/network.rs b/src/mode/station/network.rs similarity index 97% rename from src/network.rs rename to src/mode/station/network.rs index e1c70cf..3686747 100644 --- a/src/network.rs +++ b/src/mode/station/network.rs @@ -4,7 +4,7 @@ use tokio::sync::mpsc::UnboundedSender; use crate::{ app::AppResult, event::Event, - known_network::KnownNetwork, + mode::station::known_network::KnownNetwork, notification::{Notification, NotificationLevel}, }; diff --git a/src/ui.rs b/src/ui.rs index 4f7b816..33e2d33 100644 --- a/src/ui.rs +++ b/src/ui.rs @@ -2,9 +2,10 @@ use std::sync::atomic::Ordering; use ratatui::Frame; -use crate::app::{App, FocusedBlock}; - -use crate::auth::Auth; +use crate::{ + app::{App, FocusedBlock}, + mode::station::auth::Auth, +}; pub fn render(app: &mut App, frame: &mut Frame) { // Select mode