diff --git a/rkvm-client/src/client.rs b/rkvm-client/src/client.rs index 87f866f..8e2db3f 100644 --- a/rkvm-client/src/client.rs +++ b/rkvm-client/src/client.rs @@ -1,4 +1,4 @@ -use rkvm_input::{EventPack, EventWriter}; +use rkvm_input::{EventBatch, EventWriter}; use rkvm_net::auth::{AuthChallenge, AuthStatus}; use rkvm_net::message::Message; use rkvm_net::version::Version; @@ -79,7 +79,7 @@ pub async fn run( let mut writer = EventWriter::new().await.map_err(Error::Input)?; loop { - let events = EventPack::decode(&mut stream) + let events = EventBatch::decode(&mut stream) .await .map_err(Error::Network)?; writer.write(&events).await.map_err(Error::Input)?; diff --git a/rkvm-input/src/event.rs b/rkvm-input/src/event.rs index c341a67..1f86cb8 100644 --- a/rkvm-input/src/event.rs +++ b/rkvm-input/src/event.rs @@ -7,7 +7,7 @@ pub use key::Key; use serde::{Deserialize, Serialize}; use smallvec::SmallVec; -pub type EventPack = SmallVec<[Event; 2]>; +pub type EventBatch = SmallVec<[Event; 2]>; #[derive(Clone, Copy, Debug, Serialize, Deserialize)] pub enum Event { diff --git a/rkvm-input/src/event_manager.rs b/rkvm-input/src/event_manager.rs index fbbb3ce..5cc915b 100644 --- a/rkvm-input/src/event_manager.rs +++ b/rkvm-input/src/event_manager.rs @@ -1,4 +1,4 @@ -use crate::event::{Event, EventPack}; +use crate::event::{Event, EventBatch}; use crate::event_reader::{EventReader, OpenError}; use crate::event_writer::EventWriter; @@ -15,7 +15,7 @@ const EVENT_PATH: &str = "/dev/input"; pub struct EventManager { event_writer: EventWriter, - event_receiver: Receiver>, + event_receiver: Receiver>, } impl EventManager { @@ -78,7 +78,7 @@ impl EventManager { }) } - pub async fn read(&mut self) -> Result { + pub async fn read(&mut self) -> Result { self.event_receiver.recv().await.unwrap() } @@ -87,7 +87,7 @@ impl EventManager { } } -async fn spawn_reader(path: &Path, sender: Sender>) -> Result<(), Error> { +async fn spawn_reader(path: &Path, sender: Sender>) -> Result<(), Error> { if path.is_dir() { return Ok(()); } diff --git a/rkvm-input/src/event_reader.rs b/rkvm-input/src/event_reader.rs index b5a1a3f..eee2895 100644 --- a/rkvm-input/src/event_reader.rs +++ b/rkvm-input/src/event_reader.rs @@ -1,5 +1,5 @@ use crate::device_id; -use crate::event::{Axis, Direction, Event, EventPack}; +use crate::event::{Axis, Direction, Event, EventBatch}; use crate::glue::{self, libevdev, libevdev_uinput}; use crate::glue::{input_event, timeval}; use crate::KeyKind; @@ -134,9 +134,9 @@ impl EventReader { }) } - pub async fn read(&mut self) -> Result { + pub async fn read(&mut self) -> Result { loop { - let mut events = EventPack::new(); + let mut events = EventBatch::new(); let mut wrote = false; loop { diff --git a/rkvm-input/src/lib.rs b/rkvm-input/src/lib.rs index fc64f9f..cfa0df8 100644 --- a/rkvm-input/src/lib.rs +++ b/rkvm-input/src/lib.rs @@ -5,6 +5,6 @@ mod event_reader; mod event_writer; mod glue; -pub use event::{Axis, Button, Direction, Event, EventPack, Key, KeyKind}; +pub use event::{Axis, Button, Direction, Event, EventBatch, Key, KeyKind}; pub use event_manager::EventManager; pub use event_writer::EventWriter; diff --git a/rkvm-server/src/server.rs b/rkvm-server/src/server.rs index cf023f1..fceb1b5 100644 --- a/rkvm-server/src/server.rs +++ b/rkvm-server/src/server.rs @@ -1,4 +1,4 @@ -use rkvm_input::{Direction, Event, EventManager, EventPack, Key, KeyKind}; +use rkvm_input::{Direction, Event, EventBatch, EventManager, Key, KeyKind}; use rkvm_net::auth::{AuthChallenge, AuthResponse, AuthStatus}; use rkvm_net::message::Message; use rkvm_net::version::Version; @@ -127,7 +127,7 @@ enum ClientError { } async fn client( - mut receiver: Receiver, + mut receiver: Receiver, stream: TcpStream, addr: SocketAddr, acceptor: TlsAcceptor,