diff options
Diffstat (limited to 'src/command/event.rs')
-rw-r--r-- | src/command/event.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/command/event.rs b/src/command/event.rs index b205be70..f09752d6 100644 --- a/src/command/event.rs +++ b/src/command/event.rs @@ -1,7 +1,7 @@ -use std::sync::mpsc; use std::thread; use std::time::Duration; +use crossbeam_channel::unbounded; use termion::event::Key; use termion::input::TermRead; @@ -13,7 +13,7 @@ pub enum Event<I> { /// A small event handler that wrap termion input and tick events. Each event /// type is handled in its own thread and returned to a common `Receiver` pub struct Events { - rx: mpsc::Receiver<Event<Key>>, + rx: crossbeam_channel::Receiver<Event<Key>>, } #[derive(Debug, Clone, Copy)] @@ -37,7 +37,7 @@ impl Events { } pub fn with_config(config: Config) -> Events { - let (tx, rx) = mpsc::channel(); + let (tx, rx) = unbounded(); { let tx = tx.clone(); @@ -62,7 +62,7 @@ impl Events { Events { rx } } - pub fn next(&self) -> Result<Event<Key>, mpsc::RecvError> { + pub fn next(&self) -> Result<Event<Key>, crossbeam_channel::RecvError> { self.rx.recv() } } |