From 1aa4024721cf7e8ca72030e37e9559d75d117b58 Mon Sep 17 00:00:00 2001 From: Stephan Dilly Date: Sat, 28 Mar 2020 14:14:03 +0100 Subject: [PATCH] better panic message --- src/poll.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/poll.rs b/src/poll.rs index c7ebc54d..a951aca7 100644 --- a/src/poll.rs +++ b/src/poll.rs @@ -41,7 +41,7 @@ pub fn start_polling_thread() -> Receiver> { if !batch.is_empty() && last_send.elapsed() > MAX_BATCHING_DURATION { - tx1.send(batch).unwrap(); + tx1.send(batch).expect("send input event failed"); batch = Vec::new(); last_send = Instant::now(); } @@ -49,7 +49,8 @@ pub fn start_polling_thread() -> Receiver> { }); rayon_core::spawn(move || loop { - tx.send(vec![QueueEvent::Tick]).unwrap(); + tx.send(vec![QueueEvent::Tick]) + .expect("send tick event failed"); sleep(TICK_DURATION); });