From 868a7e642534975a4b374dcdd3909f33a1ccf867 Mon Sep 17 00:00:00 2001 From: Sergio Benitez Date: Thu, 16 May 2019 13:29:06 -0700 Subject: [PATCH] Update 'crossbeam' to 0.7 in 'managed_queue' example. --- examples/managed_queue/Cargo.toml | 2 +- examples/managed_queue/src/main.rs | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/managed_queue/Cargo.toml b/examples/managed_queue/Cargo.toml index 69d0306d..c2041ac3 100644 --- a/examples/managed_queue/Cargo.toml +++ b/examples/managed_queue/Cargo.toml @@ -5,5 +5,5 @@ workspace = "../.." publish = false [dependencies] -crossbeam = "0.5" +crossbeam = "0.7" rocket = { path = "../../core/lib" } diff --git a/examples/managed_queue/src/main.rs b/examples/managed_queue/src/main.rs index 5e2c4300..809dd353 100644 --- a/examples/managed_queue/src/main.rs +++ b/examples/managed_queue/src/main.rs @@ -6,9 +6,9 @@ extern crate crossbeam; #[cfg(test)] mod tests; use rocket::State; -use crossbeam::queue::MsQueue; +use crossbeam::queue::SegQueue; -struct LogChannel(MsQueue); +struct LogChannel(SegQueue); #[put("/push?")] fn push(event: String, queue: State) { @@ -16,14 +16,14 @@ fn push(event: String, queue: State) { } #[get("/pop")] -fn pop(queue: State) -> String { - queue.0.pop() +fn pop(queue: State) -> Option { + queue.0.pop().ok() } fn rocket() -> rocket::Rocket { rocket::ignite() .mount("/", routes![push, pop]) - .manage(LogChannel(MsQueue::new())) + .manage(LogChannel(SegQueue::new())) } fn main() {