From c2c10b9014549e9c0783fb13dc202dfab6e6fd0a Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sun, 30 Dec 2018 23:23:31 +0300 Subject: :arrow_up: crossbeam closes #189 --- crates/thread_worker/Cargo.toml | 2 +- crates/thread_worker/src/lib.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'crates/thread_worker') diff --git a/crates/thread_worker/Cargo.toml b/crates/thread_worker/Cargo.toml index 62d66a1a3..c74b376e2 100644 --- a/crates/thread_worker/Cargo.toml +++ b/crates/thread_worker/Cargo.toml @@ -6,6 +6,6 @@ authors = ["Aleksey Kladov "] [dependencies] drop_bomb = "0.1.0" -crossbeam-channel = "0.2.4" +crossbeam-channel = "0.3.5" log = "0.4.3" diff --git a/crates/thread_worker/src/lib.rs b/crates/thread_worker/src/lib.rs index 12e8bf17e..5e46f62fe 100644 --- a/crates/thread_worker/src/lib.rs +++ b/crates/thread_worker/src/lib.rs @@ -2,7 +2,7 @@ use std::thread; -use crossbeam_channel::{bounded, unbounded, Receiver, Sender}; +use crossbeam_channel::{bounded, unbounded, Receiver, Sender, RecvError, SendError}; use drop_bomb::DropBomb; pub struct Worker { @@ -34,10 +34,10 @@ impl Worker { self.out } - pub fn send(&self, item: I) { + pub fn send(&self, item: I) -> Result<(), SendError> { self.inp.send(item) } - pub fn recv(&self) -> Option { + pub fn recv(&self) -> Result { self.out.recv() } } -- cgit v1.2.3