Browse Source

More edition 2018 cleanup

macdev
Travis Burtrum 4 years ago
parent
commit
c2efbb6fd1
  1. 2
      src/device/builder.rs
  2. 2
      src/device/device.rs
  3. 1
      src/device/input_device.rs
  4. 5
      src/keymapper.rs
  5. 12
      src/lib.rs
  6. 8
      src/main.rs

2
src/device/builder.rs

@ -4,7 +4,7 @@ use std::ffi::CString; @@ -4,7 +4,7 @@ use std::ffi::CString;
use libc::c_int;
use nix::{self, fcntl, unistd, errno::Errno};
use nix::sys::stat;
use ffi::*;
use uinput_sys::*;
use crate::{Result as Res, Device};
use std::collections::hash_map::Values;

2
src/device/device.rs

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
use std::{mem, ptr, slice};
use libc::{timeval, gettimeofday, input_event, c_int};
use nix::{unistd, errno::Errno};
use ffi::*;
use uinput_sys::*;
use crate::{Result as Res};
/// The virtual device.

1
src/device/input_device.rs

@ -3,6 +3,7 @@ use std::fs::File; @@ -3,6 +3,7 @@ use std::fs::File;
use std::io::Read;
use std::os::unix::io::AsRawFd;
use libc::{input_event, c_int};
use nix::ioctl_write_ptr;
use crate::{Error,Result};
ioctl_write_ptr!(eviocgrab, b'E', 0x90, c_int);

5
src/keymapper.rs

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
use crate::Device;
use ffi::*;
use uinput_sys::*;
use libc::{c_int, input_event};
use std::fs::File;
@ -399,9 +399,8 @@ impl KeyMapper for Key { @@ -399,9 +399,8 @@ impl KeyMapper for Key {
}
}
extern crate toml;
use std::path::Path;
use serde_derive::Deserialize;
#[derive(Deserialize, Debug)]
pub struct KeymapConfig {

12
src/lib.rs

@ -1,18 +1,8 @@ @@ -1,18 +1,8 @@
#![recursion_limit = "1000"]
extern crate libc;
extern crate uinput_sys as ffi;
#[macro_use]
extern crate nix;
#[macro_use]
extern crate serde_derive;
use std::path::Path;
mod error;
pub mod error;
pub use error::Error;
pub type Result<T> = ::std::result::Result<T, Error>;

8
src/main.rs

@ -1,12 +1,6 @@ @@ -1,12 +1,6 @@
extern crate rusty_keys;
extern crate uinput_sys as ffi;
extern crate libc;
extern crate getopts;
extern crate inotify;
use rusty_keys::{KeyMaps, Device, InputDevice, Result};
use ffi::*;
use uinput_sys::*;
use libc::input_event;
use std::process::exit;
use std::{env, thread};

Loading…
Cancel
Save