mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-04-20 07:53:19 +03:00
add cargo fmt + cargo clippy to rust workflow
This commit is contained in:
12
.github/workflows/rust.yml
vendored
12
.github/workflows/rust.yml
vendored
@@ -25,6 +25,10 @@ jobs:
|
|||||||
run: cargo build --verbose
|
run: cargo build --verbose
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: cargo test --verbose
|
run: cargo test --verbose
|
||||||
|
- name: Check Formatting
|
||||||
|
run: cargo fmt --check
|
||||||
|
- name: Clippy
|
||||||
|
run: cargo clippy --all-features --all-targets -- --deny warnings
|
||||||
- name: Upload build artifact
|
- name: Upload build artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
@@ -41,6 +45,10 @@ jobs:
|
|||||||
run: cargo build --verbose
|
run: cargo build --verbose
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: cargo test --verbose
|
run: cargo test --verbose
|
||||||
|
- name: Check Formatting
|
||||||
|
run: cargo fmt --check
|
||||||
|
- name: Clippy
|
||||||
|
run: cargo clippy --all-features --all-targets -- --deny warnings
|
||||||
- name: Upload build artifact
|
- name: Upload build artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
@@ -57,6 +65,10 @@ jobs:
|
|||||||
run: cargo build --verbose
|
run: cargo build --verbose
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: cargo test --verbose
|
run: cargo test --verbose
|
||||||
|
- name: Check Formatting
|
||||||
|
run: cargo fmt --check
|
||||||
|
- name: Clippy
|
||||||
|
run: cargo clippy --all-features --all-targets -- --deny warnings
|
||||||
- name: Upload build artifact
|
- name: Upload build artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ use crate::{
|
|||||||
};
|
};
|
||||||
use async_trait::async_trait;
|
use async_trait::async_trait;
|
||||||
|
|
||||||
|
#[derive(Default)]
|
||||||
pub struct DummyConsumer;
|
pub struct DummyConsumer;
|
||||||
|
|
||||||
impl DummyConsumer {
|
impl DummyConsumer {
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
|
use crate::{
|
||||||
|
consumer::EventConsumer,
|
||||||
|
event::{KeyboardEvent, PointerEvent},
|
||||||
|
scancode,
|
||||||
|
};
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use crate::{consumer::EventConsumer, event::{KeyboardEvent, PointerEvent}, scancode};
|
|
||||||
use async_trait::async_trait;
|
use async_trait::async_trait;
|
||||||
use winapi::um::winuser::{KEYEVENTF_EXTENDEDKEY, SendInput};
|
use winapi::um::winuser::{SendInput, KEYEVENTF_EXTENDEDKEY};
|
||||||
use winapi::{
|
use winapi::{
|
||||||
self,
|
self,
|
||||||
um::winuser::{
|
um::winuser::{
|
||||||
@@ -179,7 +183,7 @@ fn linux_keycode_to_windows_scancode(linux_keycode: u32) -> Option<u16> {
|
|||||||
Err(_) => {
|
Err(_) => {
|
||||||
log::warn!("unknown keycode: {linux_keycode}");
|
log::warn!("unknown keycode: {linux_keycode}");
|
||||||
return None;
|
return None;
|
||||||
},
|
}
|
||||||
};
|
};
|
||||||
log::trace!("linux code: {linux_scancode:?}");
|
log::trace!("linux code: {linux_scancode:?}");
|
||||||
let windows_scancode = match scancode::Windows::try_from(linux_scancode) {
|
let windows_scancode = match scancode::Windows::try_from(linux_scancode) {
|
||||||
|
|||||||
@@ -46,7 +46,8 @@ impl X11Consumer {
|
|||||||
BTN_MIDDLE => 2,
|
BTN_MIDDLE => 2,
|
||||||
BTN_BACK => 8,
|
BTN_BACK => 8,
|
||||||
BTN_FORWARD => 9,
|
BTN_FORWARD => 9,
|
||||||
BTN_LEFT | _ => 1,
|
BTN_LEFT => 1,
|
||||||
|
_ => 1,
|
||||||
};
|
};
|
||||||
xtest::XTestFakeButtonEvent(self.display, x11_button, state as i32, 0);
|
xtest::XTestFakeButtonEvent(self.display, x11_button, state as i32, 0);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ pub struct X11Producer {}
|
|||||||
|
|
||||||
impl X11Producer {
|
impl X11Producer {
|
||||||
pub fn new() -> Result<Self> {
|
pub fn new() -> Result<Self> {
|
||||||
return Err(anyhow!("not implemented"));
|
Err(anyhow!("not implemented"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user