From 9571baa0f6836ca3add7c29995f122514db5ec4c Mon Sep 17 00:00:00 2001 From: Vladimir Burdukov Date: Mon, 12 Jan 2026 22:30:00 +0200 Subject: [PATCH] Optimize dependencies --- Cargo.lock | 57 ++++++++++++++-------------------------- bin/alisa/Cargo.toml | 4 +-- bin/elisa/Cargo.toml | 6 +---- bin/elisheba/Cargo.toml | 3 +-- bin/elisheba/src/main.rs | 9 +------ bin/elizabeth/Cargo.toml | 4 +-- bin/isabel/Cargo.toml | 7 +---- lib/bluetooth/Cargo.toml | 2 +- lib/inspinia/Cargo.toml | 4 +-- lib/sonoff/Cargo.toml | 6 +---- 10 files changed, 30 insertions(+), 72 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5076c5d..f980c28 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -76,10 +76,8 @@ version = "0.1.0" dependencies = [ "alice", "axum", - "bytes", "chipp_http", "chrono", - "futures", "futures-util", "jsonwebtoken", "log", @@ -554,14 +552,11 @@ version = "0.1.0" dependencies = [ "futures-util", "log", - "md5", "paho-mqtt", "pretty_env_logger", "roborock", - "serde", "serde_json", "tokio", - "tokio-stream", "transport", ] @@ -575,7 +570,6 @@ dependencies = [ "md5", "paho-mqtt", "pretty_env_logger", - "serde", "serde_json", "sonoff", "tokio", @@ -592,10 +586,8 @@ dependencies = [ "md5", "paho-mqtt", "pretty_env_logger", - "serde", "serde_json", "tokio", - "tokio-stream", "transport", ] @@ -699,6 +691,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ced92e76e966ca2fd84c8f7aa01a4aea65b0eb6648d72f7c8f3e2764a67fece" dependencies = [ "crc32fast", + "libz-rs-sys", "miniz_oxide", ] @@ -884,12 +877,6 @@ version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" - [[package]] name = "hashbrown" version = "0.15.2" @@ -905,7 +892,7 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7382cf6263419f2d8df38c55d7da83da5c18aef87fc7a7fc1fb1e344edfe14c1" dependencies = [ - "hashbrown 0.15.2", + "hashbrown", ] [[package]] @@ -1177,7 +1164,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" dependencies = [ "equivalent", - "hashbrown 0.15.2", + "hashbrown", ] [[package]] @@ -1224,13 +1211,10 @@ name = "isabel" version = "0.1.0" dependencies = [ "bluetooth", - "futures-util", "log", - "md5", "paho-mqtt", "pretty_env_logger", "rusqlite", - "serde", "serde_json", "tokio", "transport", @@ -1289,6 +1273,15 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "libz-rs-sys" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c10501e7805cee23da17c7790e59df2870c0d4043ec6d03f67d31e2b53e77415" +dependencies = [ + "zlib-rs", +] + [[package]] name = "libz-sys" version = "1.1.22" @@ -2182,17 +2175,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-stream" -version = "0.1.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eca58d7bba4a75707817a2c44174253f9236b2d5fbd055602e9d5c07c139a047" -dependencies = [ - "futures-core", - "pin-project-lite", - "tokio", -] - [[package]] name = "tokio-tungstenite" version = "0.26.2" @@ -2215,12 +2197,8 @@ checksum = "6b9590b93e6fcc1739458317cccd391ad3955e2bde8913edf6f95f9e65a8f034" dependencies = [ "bytes", "futures-core", - "futures-io", "futures-sink", - "futures-util", - "hashbrown 0.14.5", "pin-project-lite", - "slab", "tokio", ] @@ -2715,19 +2693,24 @@ dependencies = [ [[package]] name = "zip" -version = "2.6.1" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dcb24d0152526ae49b9b96c1dcf71850ca1e0b882e4e28ed898a93c41334744" +checksum = "12598812502ed0105f607f941c386f43d441e00148fce9dec3ca5ffb0bde9308" dependencies = [ "arbitrary", "crc32fast", - "crossbeam-utils", "flate2", "indexmap", "memchr", "zopfli", ] +[[package]] +name = "zlib-rs" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40990edd51aae2c2b6907af74ffb635029d5788228222c4bb811e9351c0caad3" + [[package]] name = "zopfli" version = "0.8.1" diff --git a/bin/alisa/Cargo.toml b/bin/alisa/Cargo.toml index d8da2e4..0b68f06 100644 --- a/bin/alisa/Cargo.toml +++ b/bin/alisa/Cargo.toml @@ -12,14 +12,12 @@ transport = { path = "../../lib/transport" } pretty_env_logger = "0.5" log = "0.4" -bytes = "1" url = "2.5" axum = "0.8" chipp_http = "1.2" -tokio = { version = "1", features = ["macros", "rt-multi-thread", "io-util", "net", "time", "signal"] } -futures = "0.3" +tokio = { version = "1", features = ["macros", "rt-multi-thread", "net", "time", "signal"] } futures-util = "0.3" jsonwebtoken = "9.3" diff --git a/bin/elisa/Cargo.toml b/bin/elisa/Cargo.toml index 9e1763b..59b1f7b 100644 --- a/bin/elisa/Cargo.toml +++ b/bin/elisa/Cargo.toml @@ -9,14 +9,10 @@ transport = { path = "../../lib/transport" } futures-util = "0.3" -tokio = { version = "1", features = ["macros", "rt-multi-thread", "io-util", "net", "time", "sync"] } +tokio = { version = "1", features = ["macros", "rt-multi-thread", "time", "sync"] } paho-mqtt = "0.13.2" pretty_env_logger = "0.5" log = "0.4" -md5 = "0.7.0" - -serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" -tokio-stream = "0.1.17" diff --git a/bin/elisheba/Cargo.toml b/bin/elisheba/Cargo.toml index 85b96d0..bdcf7da 100644 --- a/bin/elisheba/Cargo.toml +++ b/bin/elisheba/Cargo.toml @@ -11,7 +11,7 @@ sonoff = { path = "../../lib/sonoff" } transport = { path = "../../lib/transport" } futures-util = "0.3" -tokio = { version = "1", features = ["macros", "rt-multi-thread", "net", "signal", "sync"] } +tokio = { version = "1", features = ["macros", "rt-multi-thread", "time"] } paho-mqtt = "0.13.2" @@ -20,5 +20,4 @@ log = "0.4" md5 = "*" -serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" diff --git a/bin/elisheba/src/main.rs b/bin/elisheba/src/main.rs index be67c51..b407e2b 100644 --- a/bin/elisheba/src/main.rs +++ b/bin/elisheba/src/main.rs @@ -12,7 +12,6 @@ use transport::{connect_mqtt, Topic}; use futures_util::StreamExt; use log::{error, info, trace}; use paho_mqtt::{AsyncClient as MqClient, MessageBuilder, QOS_1}; -use tokio::signal::unix::{signal, SignalKind}; use tokio::{task, time}; const VERSION: &str = env!("CARGO_PKG_VERSION"); @@ -43,13 +42,7 @@ async fn main() -> Result<()> { let set_handle = task::spawn(subscribe_action(mqtt_client.clone(), client.clone())); let state_handle = task::spawn(subscribe_state(mqtt_client, storage, client)); - tokio::select! { - _ = try_join(set_handle, state_handle) => {}, - _ = tokio::spawn(async move { - let mut sig = signal(SignalKind::terminate()).unwrap(); - sig.recv().await - }) => { info!("got SIGTERM, exiting...") }, - }; + try_join(set_handle, state_handle).await?; Ok(()) } diff --git a/bin/elizabeth/Cargo.toml b/bin/elizabeth/Cargo.toml index 768f840..edec583 100644 --- a/bin/elizabeth/Cargo.toml +++ b/bin/elizabeth/Cargo.toml @@ -9,7 +9,7 @@ transport = { path = "../../lib/transport" } futures-util = "0.3" -tokio = { version = "1", features = ["macros", "rt-multi-thread", "io-util", "net", "time", "sync", "signal"] } +tokio = { version = "1", features = ["macros", "rt-multi-thread", "time", "sync", "signal"] } paho-mqtt = "0.13.2" pretty_env_logger = "0.5" @@ -17,6 +17,4 @@ log = "0.4" md5 = "0.7.0" -serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" -tokio-stream = "0.1.17" diff --git a/bin/isabel/Cargo.toml b/bin/isabel/Cargo.toml index ae293a5..357b022 100644 --- a/bin/isabel/Cargo.toml +++ b/bin/isabel/Cargo.toml @@ -7,17 +7,12 @@ edition = "2021" bluetooth = { path = "../../lib/bluetooth" } transport = { path = "../../lib/transport" } -futures-util = "0.3" - -tokio = { version = "1", features = ["macros", "rt-multi-thread", "io-util", "net", "time"] } +tokio = { version = "1", features = ["macros", "rt-multi-thread", "time"] } paho-mqtt = "0.13.2" pretty_env_logger = "0.5" log = "0.4" -md5 = "0.7.0" - -serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" rusqlite = "0.34" diff --git a/lib/bluetooth/Cargo.toml b/lib/bluetooth/Cargo.toml index 18438bd..1ce5cec 100644 --- a/lib/bluetooth/Cargo.toml +++ b/lib/bluetooth/Cargo.toml @@ -5,7 +5,7 @@ edition = "2021" [dependencies] log = "0.4" -tokio = { version = "1", features = ["io-util", "sync"] } +tokio = { version = "1", features = ["sync"] } enumflags2 = "0.7" nix = { version = "0.29.0", features = ["ioctl"] } diff --git a/lib/inspinia/Cargo.toml b/lib/inspinia/Cargo.toml index 6ba8c44..b81d28b 100644 --- a/lib/inspinia/Cargo.toml +++ b/lib/inspinia/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" log = "0.4" tokio-tungstenite = { version = "0.26.2", features = ["native-tls"] } -tokio = { version = "1", features = ["fs", "net", "sync"] } +tokio = { version = "1", features = ["fs", "io-util", "net", "sync"] } futures-util = "0.3" chipp_http = "1.2" @@ -22,4 +22,4 @@ serde_json = "1.0" chrono = { version = "0.4", features = ["std", "clock"], default-features = false } chrono-humanize = "0.2" -zip = { version = "2.6", default-features = false, features = ["deflate"] } +zip = { version = "3.0", default-features = false, features = ["deflate"] } diff --git a/lib/sonoff/Cargo.toml b/lib/sonoff/Cargo.toml index 002322d..4fbbe84 100644 --- a/lib/sonoff/Cargo.toml +++ b/lib/sonoff/Cargo.toml @@ -8,7 +8,7 @@ crypto = { path = "../crypto" } log = "0.4" futures-util = { version = "0.3.31", features = ["sink"] } -tokio-util = { version = "0.7.14", features = ["full", "codec"] } +tokio-util = { version = "0.7.14", features = ["codec", "net"] } base64 = "0.22" chipp_http = "1.2" @@ -22,10 +22,6 @@ serde_json = "1.0" [dependencies.tokio] version = "1.44" features = [ - "io-util", - "macros", "net", - "rt-multi-thread", "sync", - "time", ]