diff options
author | Toby Vincent <tobyv@tobyvin.dev> | 2024-07-20 15:51:49 -0500 |
---|---|---|
committer | Toby Vincent <tobyv@tobyvin.dev> | 2024-07-20 15:51:49 -0500 |
commit | 06dadd8cfc92b4276d44a203cb33c7b08daab308 (patch) | |
tree | 2f4cfe7964e9c5bd1077a06cc172d9138eee5449 | |
parent | 1aee2ab4b747bcae93d16f5e4437909cac897080 (diff) |
chore: remove unused deps
-rw-r--r-- | Cargo.lock | 26 | ||||
-rw-r--r-- | Cargo.toml | 7 | ||||
-rw-r--r-- | src/component.rs | 5 | ||||
-rw-r--r-- | src/error.rs | 18 | ||||
-rw-r--r-- | src/main.rs | 2 |
5 files changed, 5 insertions, 53 deletions
@@ -18,12 +18,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] -name = "anyhow" -version = "1.0.86" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" - -[[package]] name = "async-broadcast" version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -171,15 +165,6 @@ dependencies = [ ] [[package]] -name = "bincode" -version = "1.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" -dependencies = [ - "serde", -] - -[[package]] name = "bitflags" version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -460,18 +445,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] -name = "i3blocks" +name = "i3blocks-mpris" version = "0.1.0" dependencies = [ - "anyhow", - "bincode", "futures-util", "main_error", "serde", "serde_json", "thiserror", "tokio", - "unicode-segmentation", "zbus", ] @@ -956,12 +938,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] -name = "unicode-segmentation" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" - -[[package]] name = "version_check" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1,16 +1,13 @@ [package] -name = "i3blocks" +name = "i3blocks-mpris" version = "0.1.0" edition = "2021" [dependencies] -anyhow = "1.0.86" -bincode = "1.3.3" futures-util = "0.3.30" main_error = "0.1.2" serde = { version = "1.0.203", features = ["derive"] } serde_json = "1.0.120" thiserror = "1.0.61" -tokio = { version = "1.38.0", features = ["io-std", "macros", "rt-multi-thread"] } -unicode-segmentation = "1.11.0" +tokio = { version = "1.38.0", features = ["macros", "rt-multi-thread"] } zbus = { version = "4.3.0", default-features = false, features = ["tokio"] } diff --git a/src/component.rs b/src/component.rs index 6706268..3c294b3 100644 --- a/src/component.rs +++ b/src/component.rs @@ -56,10 +56,7 @@ pub trait Runner: Component + private::Sealed { .map_while(Result::ok) .flat_map(|s| serde_json::from_str::<Click>(&s)) { - if let Err(err) = <Self::Handler as Button>::handle(conn.clone(), click).await { - #[cfg(debug_assertions)] - eprintln!("Error running button handler: {err}"); - } + let _ = <Self::Handler as Button>::handle(conn.clone(), click).await; } listeners.await? diff --git a/src/error.rs b/src/error.rs index 834b7cf..77d832c 100644 --- a/src/error.rs +++ b/src/error.rs @@ -11,9 +11,6 @@ pub enum Error { #[error("Join error: {0}")] Join(#[from] tokio::task::JoinError), - #[error("Bincode error: {0}")] - Bincode(#[from] bincode::Error), - #[error("ZBus error: {0}")] ZBus(#[from] zbus::Error), @@ -26,23 +23,8 @@ pub enum Error { #[error("Json serde error: {0}")] Json(#[from] serde_json::Error), - #[error("Invalid color format: {0}")] - Color(String), - - #[error("Invalid playback state")] - PlaybackState, - - #[error("Invalid volume value")] - Volume, - #[error("Send error: {0}")] Send(String), - - #[error("Invalid instance value")] - Instance, - - #[error("Failed to get player, channel closed")] - Channel, } impl<T> From<tokio::sync::mpsc::error::SendError<T>> for Error { diff --git a/src/main.rs b/src/main.rs index aa74e09..e17742e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,4 @@ -use i3blocks::component::{Icon, Next, Play, Prev, Runner, Title, Volume}; +use i3blocks_mpris::component::{Icon, Next, Play, Prev, Runner, Title, Volume}; #[tokio::main] async fn main() -> Result<(), main_error::MainError> { |