diff --git a/Cargo.toml b/Cargo.toml index 10c628a..51a6807 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,7 +27,7 @@ tokio02 = ["tokio"] [dependencies] async-task = "3.0.0" blocking = "0.4.4" -concurrent-queue = "1.0.0" +concurrent-queue = "1.1.1" fastrand = "1.1.0" futures-io = { version = "0.3.5", default-features = false, features = ["std"] } futures-util = { version = "0.3.5", default-features = false, features = ["std", "io"] } diff --git a/src/work_stealing.rs b/src/work_stealing.rs index 5a06ca7..c09f6b3 100644 --- a/src/work_stealing.rs +++ b/src/work_stealing.rs @@ -217,12 +217,7 @@ impl Worker<'_> { if let Some(r) = self.slot.replace(Some(runnable)) { // If the slot had a task, push it into the queue. if let Err(err) = self.queue.push(r) { - use concurrent_queue::*; - match err { - PushError::Full(v) | PushError::Closed(v) => { - self.executor.injector.push(v).unwrap(); - } - } + self.executor.injector.push(err.into_inner()).unwrap(); } } } @@ -231,12 +226,7 @@ impl Worker<'_> { fn flush_slot(&self) { if let Some(r) = self.slot.take() { if let Err(err) = self.queue.push(r) { - use concurrent_queue::*; - match err { - PushError::Full(v) | PushError::Closed(v) => { - self.executor.injector.push(v).unwrap(); - } - } + self.executor.injector.push(err.into_inner()).unwrap(); } } }