add cargo fmt + cargo clippy to rust workflow

This commit is contained in:
Ferdinand Schober
2023-12-18 21:27:53 +01:00
parent 9f23e1a75d
commit 4600db7af8
6 changed files with 29 additions and 11 deletions

View File

@@ -5,6 +5,7 @@ use crate::{
};
use async_trait::async_trait;
#[derive(Default)]
pub struct DummyConsumer;
impl DummyConsumer {

View File

@@ -1,7 +1,11 @@
use crate::{
consumer::EventConsumer,
event::{KeyboardEvent, PointerEvent},
scancode,
};
use anyhow::Result;
use crate::{consumer::EventConsumer, event::{KeyboardEvent, PointerEvent}, scancode};
use async_trait::async_trait;
use winapi::um::winuser::{KEYEVENTF_EXTENDEDKEY, SendInput};
use winapi::um::winuser::{SendInput, KEYEVENTF_EXTENDEDKEY};
use winapi::{
self,
um::winuser::{
@@ -179,7 +183,7 @@ fn linux_keycode_to_windows_scancode(linux_keycode: u32) -> Option<u16> {
Err(_) => {
log::warn!("unknown keycode: {linux_keycode}");
return None;
},
}
};
log::trace!("linux code: {linux_scancode:?}");
let windows_scancode = match scancode::Windows::try_from(linux_scancode) {

View File

@@ -46,7 +46,8 @@ impl X11Consumer {
BTN_MIDDLE => 2,
BTN_BACK => 8,
BTN_FORWARD => 9,
BTN_LEFT | _ => 1,
BTN_LEFT => 1,
_ => 1,
};
xtest::XTestFakeButtonEvent(self.display, x11_button, state as i32, 0);
};

View File

@@ -13,7 +13,7 @@ pub struct X11Producer {}
impl X11Producer {
pub fn new() -> Result<Self> {
return Err(anyhow!("not implemented"));
Err(anyhow!("not implemented"))
}
}