diff options
Diffstat (limited to 'src/frontend/event.rs')
| -rw-r--r-- | src/frontend/event.rs | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/frontend/event.rs b/src/frontend/event.rs index 27dd059..65b61f1 100644 --- a/src/frontend/event.rs +++ b/src/frontend/event.rs @@ -17,12 +17,11 @@ use std::time::Duration; +use color_eyre::eyre::{OptionExt, Result}; use crossterm::event::{Event as CrosstermEvent, KeyEvent, MouseEvent}; use futures::{FutureExt, StreamExt}; use tokio::sync::mpsc; -use crate::frontend::app::AppResult; - /// Terminal events. #[derive(Clone, Copy, Debug)] pub enum Event { @@ -102,13 +101,11 @@ impl EventHandler { /// /// This function will always block the current thread if /// there is no data available and it's possible for more data to be sent. - pub async fn next(&mut self) -> AppResult<Event> { - self.receiver - .recv() - .await - .ok_or(Box::new(std::io::Error::new( - std::io::ErrorKind::Other, - "This is an IO error", - ))) + pub async fn next(&mut self) -> Result<Event> { + self.receiver.recv().await.ok_or_eyre("This is an IO error") + // .ok_or(Box::new(std::io::Error::new( + // std::io::ErrorKind::Other, + // "This is an IO error", + // ))) } } |
