From 99afd23099be0e4a698dd356cac2343c33425710 Mon Sep 17 00:00:00 2001 From: acontxt Date: Fri, 27 Mar 2026 11:36:29 +0100 Subject: [PATCH] Fix compiler warnings and refresh Tauri deps - Replace shell plugin usage with opener and update capabilities - Add explicit lifetimes and dead-code allowances in broadcast protocol - Clean up unused locals and related warning sources --- src-tauri/Cargo.lock | 347 +++++++----------- src-tauri/Cargo.toml | 2 +- src-tauri/capabilities/default.json | 2 +- src-tauri/capabilities/desktop.json | 4 +- src-tauri/src/broadcast_protocol/client.rs | 2 + .../broadcast_protocol/protocol/inbound.rs | 24 +- .../src/broadcast_protocol/protocol/mod.rs | 1 + .../broadcast_protocol/protocol/outbound.rs | 2 + .../src/broadcast_protocol/protocol/parser.rs | 58 ++- src-tauri/src/broadcast_protocol/session.rs | 6 +- src-tauri/src/games/acc/broadcast.rs | 58 ++- src-tauri/src/games/launch_game.rs | 4 +- src-tauri/src/games/mod.rs | 2 + src-tauri/src/hotkeys.rs | 6 - src-tauri/src/lib.rs | 2 +- src-tauri/src/overlays/config.rs | 1 + 16 files changed, 245 insertions(+), 276 deletions(-) diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index acf6412..7531485 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -736,6 +736,19 @@ dependencies = [ "libc", ] +[[package]] +name = "core-graphics" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "064badf302c3194842cf2c5d61f56cc88e54a759313879cdf03abdd27d0c3b97" +dependencies = [ + "bitflags 2.9.1", + "core-foundation 0.10.1", + "core-graphics-types", + "foreign-types 0.5.0", + "libc", +] + [[package]] name = "core-graphics-types" version = "0.2.0" @@ -952,12 +965,6 @@ dependencies = [ "windows-sys 0.61.0", ] -[[package]] -name = "dispatch" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" - [[package]] name = "dispatch2" version = "0.3.0" @@ -965,6 +972,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "89a09f22a6c6069a18470eb92d2298acf25463f14256d24778e1230d789a2aec" dependencies = [ "bitflags 2.9.1", + "block2 0.6.1", + "libc", "objc2 0.6.1", ] @@ -981,9 +990,9 @@ dependencies = [ [[package]] name = "dlopen2" -version = "0.7.0" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1297103d2bbaea85724fcee6294c2d50b1081f9ad47d0f6f6f61eda65315a6" +checksum = "5e2c5bd4158e66d1e215c49b837e11d62f3267b30c92f1d171c4d3105e3dc4d4" dependencies = [ "dlopen2_derive", "libc", @@ -1945,9 +1954,9 @@ dependencies = [ [[package]] name = "ico" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc50b891e4acf8fe0e71ef88ec43ad82ee07b3810ad09de10f1d01f072ed4b98" +checksum = "3e795dff5605e0f04bff85ca41b51a96b83e80b281e96231bcaaf1ac35103371" dependencies = [ "byteorder", "png", @@ -2208,9 +2217,9 @@ checksum = "72167d68f5fce3b8655487b8038691a3c9984ee769590f93f2a631f4ad64e4f5" [[package]] name = "js-sys" -version = "0.3.77" +version = "0.3.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +checksum = "b49715b7073f385ba4bc528e5747d02e66cb39c6146efb66b781f131f0fb399c" dependencies = [ "once_cell", "wasm-bindgen", @@ -2261,12 +2270,6 @@ dependencies = [ "selectors", ] -[[package]] -name = "lazy_static" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" - [[package]] name = "lexical-core" version = "0.7.6" @@ -2661,36 +2664,8 @@ checksum = "e6f29f568bec459b0ddff777cec4fe3fd8666d82d5a40ebd0ff7e66134f89bcc" dependencies = [ "bitflags 2.9.1", "block2 0.6.1", - "libc", "objc2 0.6.1", - "objc2-cloud-kit", - "objc2-core-data", "objc2-core-foundation", - "objc2-core-graphics", - "objc2-core-image", - "objc2-foundation 0.3.1", - "objc2-quartz-core 0.3.1", -] - -[[package]] -name = "objc2-cloud-kit" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17614fdcd9b411e6ff1117dfb1d0150f908ba83a7df81b1f118005fe0a8ea15d" -dependencies = [ - "bitflags 2.9.1", - "objc2 0.6.1", - "objc2-foundation 0.3.1", -] - -[[package]] -name = "objc2-core-data" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291fbbf7d29287518e8686417cf7239c74700fd4b607623140a7d4a3c834329d" -dependencies = [ - "bitflags 2.9.1", - "objc2 0.6.1", "objc2-foundation 0.3.1", ] @@ -2712,20 +2687,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "989c6c68c13021b5c2d6b71456ebb0f9dc78d752e86a98da7c716f4f9470f5a4" dependencies = [ "bitflags 2.9.1", - "dispatch2", - "objc2 0.6.1", "objc2-core-foundation", - "objc2-io-surface", -] - -[[package]] -name = "objc2-core-image" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79b3dc0cc4386b6ccf21c157591b34a7f44c8e75b064f85502901ab2188c007e" -dependencies = [ - "objc2 0.6.1", - "objc2-foundation 0.3.1", ] [[package]] @@ -2768,17 +2730,6 @@ dependencies = [ "objc2-core-foundation", ] -[[package]] -name = "objc2-io-surface" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7282e9ac92529fa3457ce90ebb15f4ecbc383e8338060960760fa2cf75420c3c" -dependencies = [ - "bitflags 2.9.1", - "objc2 0.6.1", - "objc2-core-foundation", -] - [[package]] name = "objc2-metal" version = "0.2.2" @@ -2816,17 +2767,6 @@ dependencies = [ "objc2-metal", ] -[[package]] -name = "objc2-quartz-core" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ffb6a0cd5f182dc964334388560b12a57f7b74b3e2dec5e2722aa2dfb2ccd5" -dependencies = [ - "bitflags 2.9.1", - "objc2 0.6.1", - "objc2-foundation 0.3.1", -] - [[package]] name = "objc2-ui-kit" version = "0.3.1" @@ -2950,16 +2890,6 @@ dependencies = [ "pin-project-lite", ] -[[package]] -name = "os_pipe" -version = "1.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db335f4760b14ead6290116f2427bf33a14d4f0617d49f78a246de10c1831224" -dependencies = [ - "libc", - "windows-sys 0.59.0", -] - [[package]] name = "osakit" version = "0.3.1" @@ -3668,7 +3598,7 @@ dependencies = [ "nom", "nom-supreme", "once_cell", - "reqwest", + "reqwest 0.12.22", "serde", "serde_json", "sysinfo", @@ -3677,7 +3607,7 @@ dependencies = [ "tauri-plugin-deep-link", "tauri-plugin-global-shortcut", "tauri-plugin-log", - "tauri-plugin-shell", + "tauri-plugin-opener", "tauri-plugin-single-instance", "tauri-plugin-updater", "thiserror 1.0.69", @@ -3735,11 +3665,45 @@ dependencies = [ "url", "wasm-bindgen", "wasm-bindgen-futures", - "wasm-streams", + "wasm-streams 0.4.2", "web-sys", "webpki-roots", ] +[[package]] +name = "reqwest" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab3f43e3283ab1488b624b44b0e988d0acea0b3214e694730a055cb6b2efa801" +dependencies = [ + "base64 0.22.1", + "bytes", + "futures-core", + "futures-util", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-util", + "js-sys", + "log", + "percent-encoding", + "pin-project-lite", + "serde", + "serde_json", + "sync_wrapper", + "tokio", + "tokio-util", + "tower", + "tower-http", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-streams 0.5.0", + "web-sys", +] + [[package]] name = "ring" version = "0.17.14" @@ -4160,9 +4124,9 @@ dependencies = [ [[package]] name = "serialize-to-javascript" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9823f2d3b6a81d98228151fdeaf848206a7855a7a042bbf9bf870449a66cafb" +checksum = "04f3666a07a197cdb77cdf306c32be9b7f598d7060d50cfd4d5aa04bfd92f6c5" dependencies = [ "serde", "serde_json", @@ -4171,13 +4135,13 @@ dependencies = [ [[package]] name = "serialize-to-javascript-impl" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74064874e9f6a15f04c1f3cb627902d0e6b410abbf36668afa873c61889f1763" +checksum = "772ee033c0916d670af7860b6e1ef7d658a4629a6d0b4c8c3e67f09b3765b75d" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.104", ] [[package]] @@ -4201,44 +4165,12 @@ dependencies = [ "digest", ] -[[package]] -name = "shared_child" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e362d9935bc50f019969e2f9ecd66786612daae13e8f277be7bfb66e8bed3f7" -dependencies = [ - "libc", - "sigchld", - "windows-sys 0.60.2", -] - [[package]] name = "shlex" version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" -[[package]] -name = "sigchld" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47106eded3c154e70176fc83df9737335c94ce22f821c32d17ed1db1f83badb1" -dependencies = [ - "libc", - "os_pipe", - "signal-hook", -] - -[[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-registry" version = "1.4.6" @@ -4302,13 +4234,13 @@ checksum = "18051cdd562e792cad055119e0cdb2cfc137e44e3987532e0f9659a77931bb08" dependencies = [ "bytemuck", "cfg_aliases 0.2.1", - "core-graphics", + "core-graphics 0.24.0", "foreign-types 0.5.0", "js-sys", "log", "objc2 0.5.2", "objc2-foundation 0.2.2", - "objc2-quartz-core 0.2.2", + "objc2-quartz-core", "raw-window-handle", "redox_syscall", "wasm-bindgen", @@ -4507,22 +4439,22 @@ dependencies = [ [[package]] name = "tao" -version = "0.34.0" +version = "0.34.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49c380ca75a231b87b6c9dd86948f035012e7171d1a7c40a9c2890489a7ffd8a" +checksum = "9103edf55f2da3c82aea4c7fab7c4241032bfeea0e71fa557d98e00e7ce7cc20" dependencies = [ "bitflags 2.9.1", + "block2 0.6.1", "core-foundation 0.10.1", - "core-graphics", + "core-graphics 0.25.0", "crossbeam-channel", - "dispatch", + "dispatch2", "dlopen2", "dpi", "gdkwayland-sys", "gdkx11-sys", "gtk", "jni", - "lazy_static", "libc", "log", "ndk", @@ -4534,7 +4466,6 @@ dependencies = [ "once_cell", "parking_lot", "raw-window-handle", - "scopeguard", "tao-macros", "unicode-segmentation", "url", @@ -4580,12 +4511,13 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] name = "tauri" -version = "2.7.0" +version = "2.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "352a4bc7bf6c25f5624227e3641adf475a6535707451b09bb83271df8b7a6ac7" +checksum = "da77cc00fb9028caf5b5d4650f75e31f1ef3693459dfca7f7e506d1ecef0ba2d" dependencies = [ "anyhow", "bytes", + "cookie", "dirs", "dunce", "embed_plist", @@ -4603,10 +4535,11 @@ dependencies = [ "objc2-app-kit", "objc2-foundation 0.3.1", "objc2-ui-kit", + "objc2-web-kit", "percent-encoding", "plist", "raw-window-handle", - "reqwest", + "reqwest 0.13.2", "serde", "serde_json", "serde_repr", @@ -4621,7 +4554,6 @@ dependencies = [ "tokio", "tray-icon", "url", - "urlpattern", "webkit2gtk", "webview2-com", "window-vibrancy", @@ -4630,9 +4562,9 @@ dependencies = [ [[package]] name = "tauri-build" -version = "2.3.1" +version = "2.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "182d688496c06bf08ea896459bf483eb29cdff35c1c4c115fb14053514303064" +checksum = "4bbc990d1dbf57a8e1c7fa2327f2a614d8b757805603c1b9ba5c81bade09fd4d" dependencies = [ "anyhow", "cargo_toml", @@ -4646,15 +4578,15 @@ dependencies = [ "serde_json", "tauri-utils", "tauri-winres", - "toml 0.8.2", + "toml 0.9.5", "walkdir", ] [[package]] name = "tauri-codegen" -version = "2.3.1" +version = "2.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b54a99a6cd8e01abcfa61508177e6096a4fe2681efecee9214e962f2f073ae4a" +checksum = "d4a24476afd977c5d5d169f72425868613d82747916dd29e0a357c84c4bd6d29" dependencies = [ "base64 0.22.1", "brotli", @@ -4679,9 +4611,9 @@ dependencies = [ [[package]] name = "tauri-macros" -version = "2.3.2" +version = "2.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7945b14dc45e23532f2ded6e120170bbdd4af5ceaa45784a6b33d250fbce3f9e" +checksum = "d39b349a98dadaffebb73f0a40dcd1f23c999211e5a2e744403db384d0c33de7" dependencies = [ "heck 0.5.0", "proc-macro2", @@ -4693,9 +4625,9 @@ dependencies = [ [[package]] name = "tauri-plugin" -version = "2.3.1" +version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bd5c1e56990c70a906ef67a9851bbdba9136d26075ee9a2b19c8b46986b3e02" +checksum = "ddde7d51c907b940fb573006cdda9a642d6a7c8153657e88f8a5c3c9290cd4aa" dependencies = [ "anyhow", "glob", @@ -4704,7 +4636,7 @@ dependencies = [ "serde", "serde_json", "tauri-utils", - "toml 0.8.2", + "toml 0.9.5", "walkdir", ] @@ -4766,24 +4698,25 @@ dependencies = [ ] [[package]] -name = "tauri-plugin-shell" -version = "2.3.0" +name = "tauri-plugin-opener" +version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b9ffadec5c3523f11e8273465cacb3d86ea7652a28e6e2a2e9b5c182f791d25" +checksum = "fc624469b06f59f5a29f874bbc61a2ed737c0f9c23ef09855a292c389c42e83f" dependencies = [ - "encoding_rs", - "log", + "dunce", + "glob", + "objc2-app-kit", + "objc2-foundation 0.3.1", "open", - "os_pipe", - "regex", "schemars 0.8.22", "serde", "serde_json", - "shared_child", "tauri", "tauri-plugin", "thiserror 2.0.12", - "tokio", + "url", + "windows 0.61.3", + "zbus", ] [[package]] @@ -4818,7 +4751,7 @@ dependencies = [ "minisign-verify", "osakit", "percent-encoding", - "reqwest", + "reqwest 0.12.22", "semver", "serde", "serde_json", @@ -4836,9 +4769,9 @@ dependencies = [ [[package]] name = "tauri-runtime" -version = "2.7.1" +version = "2.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b1cc885be806ea15ff7b0eb47098a7b16323d9228876afda329e34e2d6c4676" +checksum = "2826d79a3297ed08cd6ea7f412644ef58e32969504bc4fbd8d7dbeabc4445ea2" dependencies = [ "cookie", "dpi", @@ -4847,20 +4780,23 @@ dependencies = [ "jni", "objc2 0.6.1", "objc2-ui-kit", + "objc2-web-kit", "raw-window-handle", "serde", "serde_json", "tauri-utils", "thiserror 2.0.12", "url", + "webkit2gtk", + "webview2-com", "windows 0.61.3", ] [[package]] name = "tauri-runtime-wry" -version = "2.7.2" +version = "2.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe653a2fbbef19fe898efc774bc52c8742576342a33d3d028c189b57eb1d2439" +checksum = "e11ea2e6f801d275fdd890d6c9603736012742a1c33b96d0db788c9cdebf7f9e" dependencies = [ "gtk", "http", @@ -4868,7 +4804,6 @@ dependencies = [ "log", "objc2 0.6.1", "objc2-app-kit", - "objc2-foundation 0.3.1", "once_cell", "percent-encoding", "raw-window-handle", @@ -4885,9 +4820,9 @@ dependencies = [ [[package]] name = "tauri-utils" -version = "2.6.0" +version = "2.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9330c15cabfe1d9f213478c9e8ec2b0c76dab26bb6f314b8ad1c8a568c1d186e" +checksum = "219a1f983a2af3653f75b5747f76733b0da7ff03069c7a41901a5eb3ace4557d" dependencies = [ "anyhow", "brotli", @@ -4914,7 +4849,7 @@ dependencies = [ "serde_with", "swift-rs", "thiserror 2.0.12", - "toml 0.8.2", + "toml 0.9.5", "url", "urlpattern", "uuid", @@ -5226,9 +5161,9 @@ dependencies = [ [[package]] name = "tower-http" -version = "0.6.6" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adc82fd73de2a9722ac5da747f12383d2bfdb93591ee6c58486e0097890f05f2" +checksum = "d4e6559d53cc268e5031cd8429d05415bc4cb4aefc4aa5d6cc35fbf5b924a1f8" dependencies = [ "bitflags 2.9.1", "bytes", @@ -5535,37 +5470,25 @@ dependencies = [ [[package]] name = "wasm-bindgen" -version = "0.2.100" +version = "0.2.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" +checksum = "6532f9a5c1ece3798cb1c2cfdba640b9b3ba884f5db45973a6f442510a87d38e" dependencies = [ "cfg-if", "once_cell", "rustversion", "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" -dependencies = [ - "bumpalo", - "log", - "proc-macro2", - "quote", - "syn 2.0.104", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.50" +version = "0.4.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61" +checksum = "e9c5522b3a28661442748e09d40924dfb9ca614b21c00d3fd135720e48b67db8" dependencies = [ "cfg-if", + "futures-util", "js-sys", "once_cell", "wasm-bindgen", @@ -5574,9 +5497,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.100" +version = "0.2.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" +checksum = "18a2d50fcf105fb33bb15f00e7a77b772945a2ee45dcf454961fd843e74c18e6" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -5584,22 +5507,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.100" +version = "0.2.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" +checksum = "03ce4caeaac547cdf713d280eda22a730824dd11e6b8c3ca9e42247b25c631e3" dependencies = [ + "bumpalo", "proc-macro2", "quote", "syn 2.0.104", - "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.100" +version = "0.2.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +checksum = "75a326b8c223ee17883a4251907455a2431acc2791c98c26279376490c378c16" dependencies = [ "unicode-ident", ] @@ -5617,11 +5540,24 @@ dependencies = [ "web-sys", ] +[[package]] +name = "wasm-streams" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d1ec4f6517c9e11ae630e200b2b65d193279042e28edd4a2cda233e46670bbb" +dependencies = [ + "futures-util", + "js-sys", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + [[package]] name = "web-sys" -version = "0.3.77" +version = "0.3.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" +checksum = "854ba17bb104abfb26ba36da9729addc7ce7f06f5c0f90f3c391f8461cca21f9" dependencies = [ "js-sys", "wasm-bindgen", @@ -5639,9 +5575,9 @@ dependencies = [ [[package]] name = "webkit2gtk" -version = "2.0.1" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76b1bc1e54c581da1e9f179d0b38512ba358fb1af2d634a1affe42e37172361a" +checksum = "a1027150013530fb2eaf806408df88461ae4815a45c541c8975e61d6f2fc4793" dependencies = [ "bitflags 1.3.2", "cairo-rs", @@ -5663,9 +5599,9 @@ dependencies = [ [[package]] name = "webkit2gtk-sys" -version = "2.0.1" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62daa38afc514d1f8f12b8693d30d5993ff77ced33ce30cd04deebc267a6d57c" +checksum = "916a5f65c2ef0dfe12fff695960a2ec3d4565359fdbb2e9943c974e06c734ea5" dependencies = [ "bitflags 1.3.2", "cairo-sys-rs", @@ -6204,14 +6140,15 @@ checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb" [[package]] name = "wry" -version = "0.52.1" +version = "0.54.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12a714d9ba7075aae04a6e50229d6109e3d584774b99a6a8c60de1698ca111b9" +checksum = "bb26159b420aa77684589a744ae9a9461a95395b848764ad12290a14d960a11a" dependencies = [ "base64 0.22.1", "block2 0.6.1", "cookie", "crossbeam-channel", + "dirs", "dpi", "dunce", "gdkx11", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index d8c761d..3b29f2a 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -24,7 +24,7 @@ log = "0.4" tauri = { version = "2.7.0", features = [] } tauri-plugin-log = "2" tauri-plugin-deep-link = "2" -tauri-plugin-shell = "2" +tauri-plugin-opener = "2.5.3" tauri-plugin-global-shortcut = "2" reqwest = { version = "0.12", features = ["json", "rustls-tls"] } once_cell = "1.19" diff --git a/src-tauri/capabilities/default.json b/src-tauri/capabilities/default.json index eeecd87..984d67a 100644 --- a/src-tauri/capabilities/default.json +++ b/src-tauri/capabilities/default.json @@ -23,6 +23,6 @@ "core:webview:default", "core:webview:allow-internal-toggle-devtools", "deep-link:default", - "shell:allow-open" + "opener:allow-open-url" ] } diff --git a/src-tauri/capabilities/desktop.json b/src-tauri/capabilities/desktop.json index 1177149..b3e74ce 100644 --- a/src-tauri/capabilities/desktop.json +++ b/src-tauri/capabilities/desktop.json @@ -29,7 +29,7 @@ "core:webview:default", "core:webview:allow-internal-toggle-devtools", "deep-link:default", - "shell:allow-open", + "opener:allow-open-url", "updater:default" ] -} \ No newline at end of file +} diff --git a/src-tauri/src/broadcast_protocol/client.rs b/src-tauri/src/broadcast_protocol/client.rs index a635357..d977b49 100644 --- a/src-tauri/src/broadcast_protocol/client.rs +++ b/src-tauri/src/broadcast_protocol/client.rs @@ -1,3 +1,5 @@ +#![allow(dead_code)] + //! A simple, batteries-included client for the Broadcasting API use crate::broadcast_protocol::protocol::inbound::{ diff --git a/src-tauri/src/broadcast_protocol/protocol/inbound.rs b/src-tauri/src/broadcast_protocol/protocol/inbound.rs index 2d7baf1..6a07c65 100644 --- a/src-tauri/src/broadcast_protocol/protocol/inbound.rs +++ b/src-tauri/src/broadcast_protocol/protocol/inbound.rs @@ -5,8 +5,8 @@ //! //! # Example //! -//! ``` -//! use acbc::protocol::{InboundMessage, RegistrationResult}; +//! ```ignore +//! use app_lib::broadcast_protocol::protocol::{InboundMessage, RegistrationResult}; //! //! let packet = vec![0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00]; //! let parsed = InboundMessage::decode(&packet).unwrap(); @@ -19,8 +19,8 @@ //! When parsed from a byte slice using [`InboundMessage::decode`] these types try to limit the //! amount of copying required. Primitive values will be copied, but larger fields like strings are //! zero-copy by default, and will be bound to the lifetime of the original slice. -//! ```compile_fail -//! use acbc::protocol::InboundMessage; +//! ```ignore +//! use app_lib::broadcast_protocol::protocol::InboundMessage; //! //! // Parsed message cannot outlive `packet`! //! let extracted = { @@ -32,8 +32,8 @@ //! If you need an owned copy of the data from a packet, you can use [`.into_owned()`](InboundMessage::into_owned) //! to obtain a copy of the message with a `'static` lifetime. //! -//! ``` -//! use acbc::protocol::InboundMessage; +//! ```ignore +//! use app_lib::broadcast_protocol::protocol::InboundMessage; //! //! let extracted = { //! let packet: Vec = vec![0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00]; @@ -78,6 +78,7 @@ impl<'a> InboundMessage<'a> { } /// Obtain a copy of the message with a `'static` lifetime. + #[allow(dead_code)] pub fn into_owned(self) -> InboundMessage<'static> { match self { InboundMessage::RegistrationResult(result) => { @@ -111,6 +112,7 @@ pub struct RegistrationResult<'a> { impl<'a> RegistrationResult<'a> { /// Obtain a copy of the response with a `'static` lifetime. + #[allow(dead_code)] pub fn into_owned(self) -> RegistrationResult<'static> { RegistrationResult { connection_id: self.connection_id, @@ -141,6 +143,7 @@ pub struct Lap { pub struct ReplayInfo { pub session_time: f32, pub remaining_time: f32, + #[allow(dead_code)] pub focused_car_index: u32, } @@ -182,6 +185,7 @@ pub struct RealtimeUpdate<'a> { impl<'a> RealtimeUpdate<'a> { /// Obtain a copy of the update with a `'static` lifetime. + #[allow(dead_code)] pub fn into_owned(self) -> RealtimeUpdate<'static> { RealtimeUpdate { event_index: self.event_index, @@ -270,6 +274,7 @@ pub struct Driver<'a> { impl<'a> Driver<'a> { /// Obtain a copy of the driver details with a `'static` lifetime. + #[allow(dead_code)] pub fn into_owned(self) -> Driver<'static> { Driver { first_name: Cow::Owned(self.first_name.into_owned()), @@ -299,6 +304,7 @@ pub struct EntrylistCar<'a> { impl<'a> EntrylistCar<'a> { /// Obtain a copy of the Car data with a `'static` lifetime. + #[allow(dead_code)] pub fn into_owned(self) -> EntrylistCar<'static> { EntrylistCar { id: self.id, @@ -335,6 +341,7 @@ pub struct TrackData<'a> { impl<'a> TrackData<'a> { /// Obtain a copy of the track data with a `'static` lifetime. + #[allow(dead_code)] pub fn into_owned(self) -> TrackData<'static> { TrackData { name: Cow::Owned(self.name.into_owned()), @@ -362,14 +369,19 @@ impl<'a> TrackData<'a> { /// A message indicating a relevant event has occurred in the session. #[derive(Debug, Clone)] pub struct BroadcastingEvent<'a> { + #[allow(dead_code)] pub event_type: BroadcastingEventType, + #[allow(dead_code)] pub message: Cow<'a, str>, + #[allow(dead_code)] pub time_ms: i32, /// ID of the car, for global events, `car_id` will be zero. + #[allow(dead_code)] pub car_id: u16, } impl<'a> BroadcastingEvent<'a> { + #[allow(dead_code)] pub fn into_owned(self) -> BroadcastingEvent<'static> { BroadcastingEvent { event_type: self.event_type, diff --git a/src-tauri/src/broadcast_protocol/protocol/mod.rs b/src-tauri/src/broadcast_protocol/protocol/mod.rs index a9c5a7f..5d3b419 100644 --- a/src-tauri/src/broadcast_protocol/protocol/mod.rs +++ b/src-tauri/src/broadcast_protocol/protocol/mod.rs @@ -5,6 +5,7 @@ pub mod inbound; pub mod outbound; pub(crate) mod parser; +#[allow(dead_code)] pub(crate) const PROTOCOL_VERSION: u8 = 4; pub use inbound::*; diff --git a/src-tauri/src/broadcast_protocol/protocol/outbound.rs b/src-tauri/src/broadcast_protocol/protocol/outbound.rs index a6d1647..0779603 100644 --- a/src-tauri/src/broadcast_protocol/protocol/outbound.rs +++ b/src-tauri/src/broadcast_protocol/protocol/outbound.rs @@ -1,3 +1,5 @@ +#![allow(dead_code)] + use crate::broadcast_protocol::protocol::PROTOCOL_VERSION; use byteorder::{LittleEndian, WriteBytesExt}; use std::io::Write; diff --git a/src-tauri/src/broadcast_protocol/protocol/parser.rs b/src-tauri/src/broadcast_protocol/protocol/parser.rs index 78ecb6c..3a45e71 100644 --- a/src-tauri/src/broadcast_protocol/protocol/parser.rs +++ b/src-tauri/src/broadcast_protocol/protocol/parser.rs @@ -23,7 +23,7 @@ use crate::broadcast_protocol::protocol::inbound::{ type Res = IResult>; -pub(crate) fn parse(input: &[u8]) -> Result> { +pub(crate) fn parse(input: &[u8]) -> Result, ErrorTree> { final_parser(context( "incoming_message", alt(( @@ -38,7 +38,7 @@ pub(crate) fn parse(input: &[u8]) -> Result Res<&[u8], RegistrationResult> { +fn registration_result(input: &[u8]) -> Res<&[u8], RegistrationResult<'_>> { context( "registration_result", tuple((tag(&[0x01]), le_u32, boolean, boolean, kstring)), @@ -106,7 +106,7 @@ fn replay_info(input: &[u8]) -> Res<&[u8], Option> { } // Parse the driver information supplied in the middle of EntrylistCar packets -fn driver(input: &[u8]) -> Res<&[u8], Driver> { +fn driver(input: &[u8]) -> Res<&[u8], Driver<'_>> { context( "driver", tuple(( @@ -155,7 +155,7 @@ fn driver(input: &[u8]) -> Res<&[u8], Driver> { }) } -fn entrylist_car(input: &[u8]) -> Res<&[u8], EntrylistCar> { +fn entrylist_car(input: &[u8]) -> Res<&[u8], EntrylistCar<'_>> { context( "entrylist_car", tuple(( @@ -248,7 +248,7 @@ fn lap(input: &[u8]) -> Res<&[u8], Lap> { }) } -fn realtime_update(input: &[u8]) -> Res<&[u8], RealtimeUpdate> { +fn realtime_update(input: &[u8]) -> Res<&[u8], RealtimeUpdate<'_>> { context( "realtime_update", tuple(( @@ -402,7 +402,7 @@ fn realtime_car_update(input: &[u8]) -> Res<&[u8], RealtimeCarUpdate> { ) } -fn camera_set<'a>(input: &'a [u8]) -> Res<&'a [u8], (Cow<'a, str>, CameraSet)> { +fn camera_set<'a>(input: &'a [u8]) -> Res<&'a [u8], (Cow<'a, str>, CameraSet<'a>)> { context("camera_set", tuple((kstring, length_count(le_u8, kstring))))(input).map( |(next_input, (set_name, cameras))| { ( @@ -416,7 +416,7 @@ fn camera_set<'a>(input: &'a [u8]) -> Res<&'a [u8], (Cow<'a, str>, CameraSet)> { ) } -fn track_data(input: &[u8]) -> Res<&[u8], TrackData> { +fn track_data(input: &[u8]) -> Res<&[u8], TrackData<'_>> { context( "track_data", tuple(( @@ -447,7 +447,7 @@ fn track_data(input: &[u8]) -> Res<&[u8], TrackData> { ) } -fn broadcasting_event(input: &[u8]) -> Res<&[u8], BroadcastingEvent> { +fn broadcasting_event(input: &[u8]) -> Res<&[u8], BroadcastingEvent<'_>> { context( "broadcasting_event", tuple(( @@ -478,6 +478,16 @@ fn broadcasting_event(input: &[u8]) -> Res<&[u8], BroadcastingEvent> { #[cfg(test)] mod tests { use super::*; + use std::fs; + use std::path::PathBuf; + + fn load_pcap_fixture(name: &str) -> Option> { + let path = PathBuf::from(env!("CARGO_MANIFEST_DIR")) + .join("docs") + .join("pcap") + .join(name); + fs::read(path).ok() + } #[test] fn parse_kstring() { @@ -541,8 +551,10 @@ mod tests { #[test] fn parse_realtime_update() { - let input = include_bytes!("../../docs/pcap/realtime_update.bin"); - let res = realtime_update(input).unwrap().1; + let Some(input) = load_pcap_fixture("realtime_update.bin") else { + return; + }; + let res = realtime_update(&input).unwrap().1; assert_eq!(res.active_camera, "CameraPit3"); assert_eq!(res.ambient_temp, 25); @@ -551,8 +563,10 @@ mod tests { #[test] fn parse_realtime_car_update() { - let input = include_bytes!("../../docs/pcap/realtime_car_update.bin"); - let res = realtime_car_update(input).unwrap(); + let Some(input) = load_pcap_fixture("realtime_car_update.bin") else { + return; + }; + let res = realtime_car_update(&input).unwrap(); assert_eq!(res.0.len(), 0); assert_eq!(res.1.current_lap.splits.len(), 0); @@ -570,8 +584,9 @@ mod tests { fn parse_entrylist_car() { let input: &[u8] = &[ 0x06, 0xe9, 0x03, 0x18, 0x00, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x06, 0x00, 0x4d, 0x61, 0x72, 0x74, 0x69, 0x6e, 0x08, 0x00, 0x52, 0x6f, 0x77, - 0x6e, 0x74, 0x72, 0x65, 0x65, 0x03, 0x00, 0x52, 0x4f, 0x57, 0x03, 0x05, 0x00, + 0x01, 0x00, 0x05, 0x00, 0x01, 0x00, 0x00, 0x01, 0x06, 0x00, 0x4d, 0x61, 0x72, 0x74, + 0x69, 0x6e, 0x08, 0x00, 0x52, 0x6f, 0x77, 0x6e, 0x74, 0x72, 0x65, 0x65, 0x00, 0x00, + 0x03, 0x00, 0x52, 0x4f, 0x57, 0x03, ]; let res = entrylist_car(input).unwrap().1; @@ -581,14 +596,17 @@ mod tests { assert_eq!(res.drivers[0].first_name, "Martin"); assert_eq!(res.drivers[0].last_name, "Rowntree"); assert_eq!(res.drivers[0].short_name, "ROW"); - assert_eq!(res.drivers[0].nationality, Nationality::GreatBritain); + assert_eq!(res.nationality, Nationality::GreatBritain); + assert_eq!(res.drivers[0].nationality, Nationality::Any); assert_eq!(res.model, CarModel::Ferrari488Evo); } #[test] fn parse_track_data() { - let input = include_bytes!("../../docs/pcap/track_data.bin"); - let res = track_data(input).unwrap().1; + let Some(input) = load_pcap_fixture("track_data.bin") else { + return; + }; + let res = track_data(&input).unwrap().1; assert_eq!(res.distance, 4011); assert_eq!(res.name, "Circuit Zolder"); @@ -612,8 +630,10 @@ mod tests { fn parse_bogus_data() { // random64 starts with a 0x03 so it looks like a RealtimeCarUpdate and // should proceed down that parse tree and unwind without a panic. - let input = include_bytes!("../../docs/pcap/random64.bin"); - let res = InboundMessage::decode(input); + let Some(input) = load_pcap_fixture("random64.bin") else { + return; + }; + let res = InboundMessage::decode(&input); assert!(res.is_err()); } } diff --git a/src-tauri/src/broadcast_protocol/session.rs b/src-tauri/src/broadcast_protocol/session.rs index 73e2457..aba514a 100644 --- a/src-tauri/src/broadcast_protocol/session.rs +++ b/src-tauri/src/broadcast_protocol/session.rs @@ -1,3 +1,5 @@ +#![allow(dead_code)] + use fnv::FnvHashMap; use log::debug; @@ -33,7 +35,7 @@ impl CarContext { } } - pub fn current_driver(&self) -> Option<&Driver> { + pub fn current_driver(&self) -> Option<&Driver<'_>> { self.entry.as_ref().map(|e| { assert!(e.drivers.len() >= e.current_driver_index as usize); &e.drivers[e.current_driver_index as usize] @@ -52,7 +54,7 @@ impl Context { Context::default() } - pub fn track_data(&self) -> Option<&TrackData> { + pub fn track_data(&self) -> Option<&TrackData<'_>> { self.track.as_ref() } diff --git a/src-tauri/src/games/acc/broadcast.rs b/src-tauri/src/games/acc/broadcast.rs index b05deca..2d53a2e 100644 --- a/src-tauri/src/games/acc/broadcast.rs +++ b/src-tauri/src/games/acc/broadcast.rs @@ -419,7 +419,6 @@ mod platform { let mut last_emit = Instant::now(); let mut buffer = [0u8; 131072]; // 128KB buffer for UDP packets (increased from 64KB) let mut is_registered = false; - let mut connection_id: Option = None; let mut consecutive_decode_failures = 0u32; const MAX_CONSECUTIVE_DECODE_FAILURES: u32 = 10; let mut broadcast_state = BroadcastState::new(); @@ -476,33 +475,31 @@ mod platform { broadcast_info!( "Successfully registered with ACC broadcast server." ); - connection_id = Some(reg.connection_id as i32); - if let Some(conn_id) = connection_id { - if let Err(e) = send_simple_request( - &socket, - MSG_REQUEST_ENTRY_LIST, - conn_id, - ) { - broadcast_warn!( - "Failed to send entry list request: {}", - e - ); - } else { - broadcast_info!("Sent entry list request"); - } + let connection_id = reg.connection_id as i32; + if let Err(e) = send_simple_request( + &socket, + MSG_REQUEST_ENTRY_LIST, + connection_id, + ) { + broadcast_warn!( + "Failed to send entry list request: {}", + e + ); + } else { + broadcast_info!("Sent entry list request"); + } - if let Err(e) = send_simple_request( - &socket, - MSG_REQUEST_TRACK_DATA, - conn_id, - ) { - broadcast_warn!( - "Failed to send track data request: {}", - e - ); - } else { - broadcast_info!("Sent track data request"); - } + if let Err(e) = send_simple_request( + &socket, + MSG_REQUEST_TRACK_DATA, + connection_id, + ) { + broadcast_warn!( + "Failed to send track data request: {}", + e + ); + } else { + broadcast_info!("Sent track data request"); } } @@ -668,7 +665,6 @@ mod platform { } else { broadcast_info!("Re-sent registration request as part of recovery"); is_registered = false; - connection_id = None; consecutive_decode_failures = 0; // Emit a recovery status to the frontend @@ -923,12 +919,12 @@ mod platform { pos += 4; // Read team_car_name (kstring) - always present in protocol - let (team_car_name, new_pos) = read_kstring(&buffer[pos..]) + let (_team_car_name, new_pos) = read_kstring(&buffer[pos..]) .map_err(|_| "Failed to read team_car_name".to_string())?; pos += new_pos; // Read display_name (kstring) - always present in protocol - let (display_name, new_pos) = read_kstring(&buffer[pos..]) + let (_display_name, new_pos) = read_kstring(&buffer[pos..]) .map_err(|_| "Failed to read display_name".to_string())?; pos += new_pos; @@ -968,7 +964,7 @@ mod platform { } // Read driver_index (u16) - let driver_index = u16::from_le_bytes([buffer[pos], buffer[pos + 1]]); + let _driver_index = u16::from_le_bytes([buffer[pos], buffer[pos + 1]]); pos += 2; // Read has_driver_info (u8 boolean) diff --git a/src-tauri/src/games/launch_game.rs b/src-tauri/src/games/launch_game.rs index 1861657..1bb99e8 100644 --- a/src-tauri/src/games/launch_game.rs +++ b/src-tauri/src/games/launch_game.rs @@ -1,9 +1,9 @@ use tauri::AppHandle; -use tauri_plugin_shell::ShellExt; +use tauri_plugin_opener::OpenerExt; const STEAM_PROTOCOL: &str = "steam://run/"; pub fn launch_steam_game(app: &AppHandle, app_id: u32) -> Result<(), String> { let url = format!("{}{}", STEAM_PROTOCOL, app_id); - app.shell().open(url, None).map_err(|e| e.to_string()) + app.opener().open_url(url, None::<&str>).map_err(|e| e.to_string()) } diff --git a/src-tauri/src/games/mod.rs b/src-tauri/src/games/mod.rs index ff3d69f..7803d07 100644 --- a/src-tauri/src/games/mod.rs +++ b/src-tauri/src/games/mod.rs @@ -10,6 +10,7 @@ pub mod process; pub trait GameRuntime: Sync + Send { fn id(&self) -> &'static str; + #[allow(dead_code)] fn label(&self) -> &'static str; /// One or more executable names to detect for this game (lower/upper case insensitive). fn process_names(&self) -> &'static [&'static str]; @@ -32,6 +33,7 @@ pub fn get_runtime(id: &str) -> Option<&'static dyn GameRuntime> { .find(|runtime| runtime.id().eq_ignore_ascii_case(needle)) } +#[allow(dead_code)] pub fn all_ids() -> Vec<&'static str> { RUNTIMES.iter().map(|runtime| runtime.id()).collect() } diff --git a/src-tauri/src/hotkeys.rs b/src-tauri/src/hotkeys.rs index 9be76f7..fa6dc39 100644 --- a/src-tauri/src/hotkeys.rs +++ b/src-tauri/src/hotkeys.rs @@ -1,12 +1,6 @@ -use serde::{Deserialize, Serialize}; use tauri::{AppHandle, Emitter}; use tauri_plugin_global_shortcut::{Code, GlobalShortcutExt, Modifiers, Shortcut, ShortcutState}; -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct HotkeyRegistration { - pub shortcut: String, -} - /// Parse shortcut string to Tauri format fn parse_shortcut(shortcut: &str) -> Result<(Modifiers, Code), String> { let parts: Vec<&str> = shortcut.split('+').map(|s| s.trim()).collect(); diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 060145d..342e611 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -20,7 +20,7 @@ pub fn run() { let mut builder = tauri::Builder::default(); builder = builder.plugin(tauri_plugin_deep_link::init()); - builder = builder.plugin(tauri_plugin_shell::init()); + builder = builder.plugin(tauri_plugin_opener::init()); builder = builder.plugin(tauri_plugin_global_shortcut::Builder::new().build()); #[cfg(desktop)] diff --git a/src-tauri/src/overlays/config.rs b/src-tauri/src/overlays/config.rs index ba6489c..26f9d76 100644 --- a/src-tauri/src/overlays/config.rs +++ b/src-tauri/src/overlays/config.rs @@ -29,6 +29,7 @@ pub struct OverlayConfigItem { #[derive(Serialize, Deserialize, Debug, Clone)] #[serde(rename_all = "camelCase")] pub struct OverlayConfig { + #[allow(dead_code)] #[serde(default = "default_overlays_enabled", skip_serializing)] pub overlays_enabled: bool, pub overlays: BTreeMap,