summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Oram <dev@mitmaro.ca>2024-02-15 10:08:23 -0330
committerTim Oram <dev@mitmaro.ca>2024-02-15 20:27:06 -0330
commit3d63f7fa3326f2a1dd0cfa12d183742e0b33a17a (patch)
tree0a2bd2fa9be6200ddb24c785f2160e34ebe75d59
parent172cc18aadf7c30ac73bf05c46560d4e54e51e90 (diff)
Cleanup crossterm declarations
-rw-r--r--src/input.rs2
-rw-r--r--src/input/event.rs4
-rw-r--r--src/input/event_provider.rs6
-rw-r--r--src/input/key_event.rs2
-rw-r--r--src/input/thread.rs3
5 files changed, 8 insertions, 9 deletions
diff --git a/src/input.rs b/src/input.rs
index a4e8d96..0111011 100644
--- a/src/input.rs
+++ b/src/input.rs
@@ -17,7 +17,7 @@ mod key_event;
mod standard_event;
mod thread;
-pub(crate) use crossterm::event::{KeyCode, KeyModifiers, MouseEvent, MouseEventKind};
+pub(crate) use crossterm::event::{KeyCode, KeyEventKind, KeyModifiers, MouseEvent, MouseEventKind};
pub(crate) use self::{
event::Event,
diff --git a/src/input/event.rs b/src/input/event.rs
index f96f817..23dbc2f 100644
--- a/src/input/event.rs
+++ b/src/input/event.rs
@@ -1,6 +1,4 @@
-use crossterm::event::{KeyCode, MouseEvent};
-
-use crate::input::{KeyEvent, StandardEvent};
+use crate::input::{KeyCode, KeyEvent, MouseEvent, StandardEvent};
/// An event, either from an input device, system change or action event.
#[derive(Debug, PartialOrd, PartialEq, Eq, Clone, Copy)]
diff --git a/src/input/event_provider.rs b/src/input/event_provider.rs
index 477dbba..d6879cb 100644
--- a/src/input/event_provider.rs
+++ b/src/input/event_provider.rs
@@ -3,11 +3,13 @@ use std::time::Duration;
use anyhow::{anyhow, Result};
#[cfg(not(test))]
use crossterm::event::{poll, read};
-use crossterm::event::{Event, KeyEvent, KeyEventKind, MouseEvent, MouseEventKind};
+use crossterm::event::{Event, KeyEvent};
#[cfg(test)]
use read_event_mocks::{poll, read};
-/// Function that returns a event
+use crate::input::{KeyEventKind, MouseEvent, MouseEventKind};
+
+/// Function that returns an event
pub(crate) trait EventReaderFn: Fn() -> Result<Option<Event>> + Send + Sync + 'static {}
impl<FN: Fn() -> Result<Option<Event>> + Send + Sync + 'static> EventReaderFn for FN {}
diff --git a/src/input/key_event.rs b/src/input/key_event.rs
index b88fcc4..a947e20 100644
--- a/src/input/key_event.rs
+++ b/src/input/key_event.rs
@@ -1,4 +1,4 @@
-use crossterm::event::{KeyCode, KeyModifiers};
+use crate::input::{KeyCode, KeyModifiers};
/// Represents a key event.
#[derive(Debug, PartialOrd, PartialEq, Eq, Clone, Copy)]
diff --git a/src/input/thread.rs b/src/input/thread.rs
index b9897de..657ea88 100644
--- a/src/input/thread.rs
+++ b/src/input/thread.rs
@@ -91,11 +91,10 @@ where EventProvider: EventReaderFn
#[cfg(test)]
mod tests {
use anyhow::anyhow;
- use crossterm::event::{KeyCode, KeyModifiers};
use super::*;
use crate::{
- input::KeyEvent,
+ input::{KeyCode, KeyEvent, KeyModifiers},
runtime::Status,
test_helpers::{create_event_reader, testers},
};