From 14cb67d5340cb2f7d6d4434c64ca9b09c70a44e2 Mon Sep 17 00:00:00 2001 From: htrefil <8711792+htrefil@users.noreply.github.com> Date: Fri, 13 Nov 2020 19:22:53 +0100 Subject: [PATCH] Clean up crate structure --- input/src/lib.rs | 6 ------ input/src/linux.rs | 2 ++ input/src/{ => linux}/device_id.rs | 0 input/src/linux/event.rs | 4 ++-- input/src/linux/event_reader.rs | 4 ++-- input/src/linux/event_writer.rs | 4 ++-- input/src/{ => linux}/glue.rs | 0 7 files changed, 8 insertions(+), 12 deletions(-) rename input/src/{ => linux}/device_id.rs (100%) rename input/src/{ => linux}/glue.rs (100%) diff --git a/input/src/lib.rs b/input/src/lib.rs index d10c4ad..dfc140c 100644 --- a/input/src/lib.rs +++ b/input/src/lib.rs @@ -1,11 +1,5 @@ -#[cfg(target_os = "linux")] -mod device_id; - mod event; -#[cfg(target_os = "linux")] -mod glue; - #[cfg(target_os = "linux")] mod linux; diff --git a/input/src/linux.rs b/input/src/linux.rs index 80a7408..743fdd9 100644 --- a/input/src/linux.rs +++ b/input/src/linux.rs @@ -1,7 +1,9 @@ +mod device_id; mod event; mod event_manager; mod event_reader; mod event_writer; +mod glue; pub use event_manager::EventManager; pub use event_writer::EventWriter; diff --git a/input/src/device_id.rs b/input/src/linux/device_id.rs similarity index 100% rename from input/src/device_id.rs rename to input/src/linux/device_id.rs diff --git a/input/src/linux/event.rs b/input/src/linux/event.rs index 241cb3c..b88c8c0 100644 --- a/input/src/linux/event.rs +++ b/input/src/linux/event.rs @@ -1,8 +1,8 @@ mod button; mod key; -use crate::event::{Axis, Direction, Event, KeyKind}; -use crate::glue::{self, input_event, timeval}; +use crate::event::{Axis, Button, Direction, Event, Key, KeyKind}; +use crate::linux::glue::{self, input_event, timeval}; impl Event { pub(crate) fn to_raw(&self) -> Option { diff --git a/input/src/linux/event_reader.rs b/input/src/linux/event_reader.rs index e040c9f..555a7bf 100644 --- a/input/src/linux/event_reader.rs +++ b/input/src/linux/event_reader.rs @@ -1,6 +1,6 @@ -use crate::device_id; use crate::event::Event; -use crate::glue::{self, libevdev, libevdev_uinput}; +use crate::linux::device_id; +use crate::linux::glue::{self, libevdev, libevdev_uinput}; use std::fs::{File, OpenOptions}; use std::io::{Error, ErrorKind}; use std::mem::MaybeUninit; diff --git a/input/src/linux/event_writer.rs b/input/src/linux/event_writer.rs index 31c3419..7c70415 100644 --- a/input/src/linux/event_writer.rs +++ b/input/src/linux/event_writer.rs @@ -1,6 +1,6 @@ -use crate::device_id; use crate::event::Event; -use crate::glue::{self, input_event, libevdev, libevdev_uinput}; +use crate::linux::device_id; +use crate::linux::glue::{self, input_event, libevdev, libevdev_uinput}; use std::io::{Error, ErrorKind}; use std::mem::MaybeUninit; use std::ops::RangeInclusive; diff --git a/input/src/glue.rs b/input/src/linux/glue.rs similarity index 100% rename from input/src/glue.rs rename to input/src/linux/glue.rs