diff --git a/Cargo.lock b/Cargo.lock index 28bbae5c40..5f4baeba46 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -482,16 +482,6 @@ dependencies = [ "libc", ] -[[package]] -name = "crossbeam-channel" -version = "0.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" -dependencies = [ - "cfg-if", - "crossbeam-utils", -] - [[package]] name = "crossbeam-utils" version = "0.8.16" @@ -1070,7 +1060,6 @@ dependencies = [ "chrono", "chrono-tz", "clap", - "crossbeam-channel", "dirs", "env_logger", "futures", diff --git a/Cargo.toml b/Cargo.toml index 15d0f6bda4..1e45b4d65d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,7 +32,6 @@ calibright = { version = "0.1", features = ["watch"] } chrono = { version = "0.4", default-features = false, features = ["clock", "unstable-locales"] } chrono-tz = { version = "0.8", features = ["serde"] } clap = { version = "4.0", default-features = false, features = ["std", "derive", "help", "usage"] } -crossbeam-channel = "0.5" dirs = "5.0" env_logger = "0.10" futures = { version = "0.3", default-features = false } diff --git a/src/blocks/sound/pulseaudio.rs b/src/blocks/sound/pulseaudio.rs index 1cd2326813..9a9d1f8a0f 100644 --- a/src/blocks/sound/pulseaudio.rs +++ b/src/blocks/sound/pulseaudio.rs @@ -9,8 +9,6 @@ use libpulse_binding::mainloop::standard::{IterateResult, Mainloop}; use libpulse_binding::proplist::{properties, Proplist}; use libpulse_binding::volume::{ChannelVolumes, Volume}; -use crossbeam_channel::{unbounded, Sender}; - use std::cmp::{max, min}; use std::convert::{TryFrom, TryInto}; use std::io; @@ -49,7 +47,7 @@ struct Connection { } struct Client { - send_req: Sender, + send_req: std::sync::mpsc::Sender, ml_waker: MainloopWaker, } @@ -198,7 +196,7 @@ impl Connection { impl Client { fn new() -> Result { - let (send_req, recv_req) = unbounded(); + let (send_req, recv_req) = std::sync::mpsc::channel(); let ml_waker = MainloopWaker::new().unwrap(); Connection::spawn("sound_pulseaudio", move |mut connection| { @@ -238,11 +236,11 @@ impl Client { } loop { + use std::sync::mpsc::TryRecvError; let req = match recv_req.try_recv() { Ok(x) => x, - Err(e) if e.is_empty() => break, - Err(e) if e.is_disconnected() => return false, - Err(_) => unreachable!(), + Err(TryRecvError::Empty) => break, + Err(TryRecvError::Disconnected) => return false, }; use ClientRequest::*;