Remove unused variants
Some checks failed
Cargo CI / Build and Test (pull_request) Successful in 2m1s
Cargo CI / Lint (pull_request) Failing after 1m4s

This commit is contained in:
Wojciech Kozlowski 2024-08-24 14:58:30 +02:00
parent 86f539d1f6
commit 1753203c7d
3 changed files with 2 additions and 8 deletions

View File

@ -1,4 +1,4 @@
use crossterm::event::{KeyEvent, MouseEvent}; use crossterm::event::KeyEvent;
use std::fmt; use std::fmt;
use std::sync::mpsc; use std::sync::mpsc;
@ -36,8 +36,6 @@ impl From<mpsc::RecvError> for EventError {
#[derive(Clone, Copy, Debug)] #[derive(Clone, Copy, Debug)]
pub enum Event { pub enum Event {
Key(KeyEvent), Key(KeyEvent),
Mouse(MouseEvent),
Resize(u16, u16),
} }
pub struct EventChannel { pub struct EventChannel {

View File

@ -41,8 +41,6 @@ impl<APP: IAppInteract> IEventHandler<APP> for EventHandler {
fn handle_next_event(&self, mut app: APP) -> Result<APP, EventError> { fn handle_next_event(&self, mut app: APP) -> Result<APP, EventError> {
match self.events.recv()? { match self.events.recv()? {
Event::Key(key_event) => app = Self::handle_key_event(app, key_event), Event::Key(key_event) => app = Self::handle_key_event(app, key_event),
Event::Mouse(_) => {}
Event::Resize(_, _) => {}
}; };
Ok(app) Ok(app)
} }

View File

@ -33,9 +33,7 @@ impl IEventListener for EventListener {
Ok(event) => { Ok(event) => {
if let Err(err) = match event { if let Err(err) = match event {
CrosstermEvent::Key(e) => self.events.send(Event::Key(e)), CrosstermEvent::Key(e) => self.events.send(Event::Key(e)),
CrosstermEvent::Mouse(e) => self.events.send(Event::Mouse(e)), _ => Ok(()),
CrosstermEvent::Resize(w, h) => self.events.send(Event::Resize(w, h)),
_ => unimplemented!(),
} { } {
return err; return err;
} }