From 8f384f9b673918194a648184a1ced4499560fab5 Mon Sep 17 00:00:00 2001 From: buffet Date: Fri, 11 Jan 2019 09:14:59 +0100 Subject: [PATCH] get rid of redundant names --- src/input/input_manager.rs | 8 -------- src/input/manager.rs | 17 +++++++++++++++++ src/input/mod.rs | 4 ++-- src/main.rs | 2 +- 4 files changed, 20 insertions(+), 11 deletions(-) delete mode 100644 src/input/input_manager.rs create mode 100644 src/input/manager.rs diff --git a/src/input/input_manager.rs b/src/input/input_manager.rs deleted file mode 100644 index 40eff9a..0000000 --- a/src/input/input_manager.rs +++ /dev/null @@ -1,8 +0,0 @@ -use crate::input::Keyboard; - -use wlroots::input; - -pub fn input_manager() -> input::manager::Builder { - input::manager::Builder::default() - .keyboard_added(|_compositor_handle, _keyboard_handle| Some(Box::new(Keyboard))) -} diff --git a/src/input/manager.rs b/src/input/manager.rs new file mode 100644 index 0000000..89f6efd --- /dev/null +++ b/src/input/manager.rs @@ -0,0 +1,17 @@ +use crate::input::Keyboard; + +use wlroots::{ + compositor, + input::{self, keyboard}, +}; + +pub fn manager() -> input::manager::Builder { + input::manager::Builder::default().keyboard_added(keyboard_added) +} + +fn keyboard_added( + _compositor_handle: compositor::Handle, + _keyboard_handle: keyboard::Handle, +) -> Option> { + Some(Box::new(Keyboard)) +} diff --git a/src/input/mod.rs b/src/input/mod.rs index c52eb78..a261e73 100644 --- a/src/input/mod.rs +++ b/src/input/mod.rs @@ -1,5 +1,5 @@ -mod input_manager; +mod manager; mod keyboard; -pub use self::input_manager::*; +pub use self::manager::*; pub use self::keyboard::*; diff --git a/src/main.rs b/src/main.rs index ecf62c0..76b75ae 100644 --- a/src/main.rs +++ b/src/main.rs @@ -25,6 +25,6 @@ fn build_compositor() -> compositor::Compositor { compositor::Builder::new() .gles2(true) .data_device(true) - .input_manager(input::input_manager()) + .input_manager(input::manager()) .build_auto(()) }