From 10bad4ebe383b1ba08f8f947726490dbb5040807 Mon Sep 17 00:00:00 2001 From: Dorota Czaplejewicz Date: Wed, 9 Oct 2019 08:15:03 +0000 Subject: [PATCH] warnings: Fix and silence --- src/data.rs | 2 +- src/keyboard.rs | 4 ---- src/layout.rs | 2 ++ src/lib.rs | 3 ++- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/data.rs b/src/data.rs index 95a2b7ee..98266c90 100644 --- a/src/data.rs +++ b/src/data.rs @@ -644,7 +644,7 @@ mod tests { /// First fallback should be to builtin, not to FALLBACK_LAYOUT_NAME #[test] fn fallbacks_order() { - let (layout, source, _failure) = load_layout( + let (_layout, source, _failure) = load_layout( "nb", Some(PathBuf::from("tests")) ); diff --git a/src/keyboard.rs b/src/keyboard.rs index 16e7c035..9b7c7e9b 100644 --- a/src/keyboard.rs +++ b/src/keyboard.rs @@ -16,10 +16,6 @@ use std::iter::{ FromIterator, IntoIterator }; pub mod c { use super::*; use ::util::c; - use ::util::c::as_cstr; - - use std::ffi::CString; - use std::os::raw::c_char; pub type CKeyState = c::Wrapped; diff --git a/src/layout.rs b/src/layout.rs index 775491b9..bbbf3263 100644 --- a/src/layout.rs +++ b/src/layout.rs @@ -253,6 +253,8 @@ pub mod c { angle: i32 ) -> u32; + // CKeyState is safe to pass to C as long as nothing dereferences it + #[allow(improper_ctypes)] pub fn eek_keyboard_set_key_locked( keyboard: *mut LevelKeyboard, key: ::keyboard::c::CKeyState, diff --git a/src/lib.rs b/src/lib.rs index 003b1c6b..0425601c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,6 +1,7 @@ #[macro_use] extern crate bitflags; -#[macro_use] +#[allow(unused_imports)] +#[macro_use] // only for tests extern crate maplit; extern crate serde; extern crate xkbcommon;