Skip to content

Commit

Permalink
chore: clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
jtroo committed Jun 22, 2024
1 parent edbe161 commit 9f939cd
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 32 deletions.
12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,18 @@ path = "src/main.rs"

[dependencies]
anyhow = "1"
clap = { version = "4", features = [ "std", "derive", "help", "suggestions" ], default_features = false }
clap = { version = "4", features = [ "std", "derive", "help", "suggestions" ], default-features = false }
dirs = "5.0.1"
indoc = { version = "2.0.4", optional = true }
instant = { version = "0.1.12", default_features = false }
log = { version = "0.4.8", default_features = false }
instant = { version = "0.1.12", default-features = false }
log = { version = "0.4.8", default-features = false }
miette = { version = "5.7.0", features = ["fancy"] }
once_cell = "1"
parking_lot = "0.12"
radix_trie = "0.2"
rustc-hash = "1.1.0"
simplelog = "0.12.0"
serde_json = { version = "1", features = ["std"], default_features = false, optional = true }
serde_json = { version = "1", features = ["std"], default-features = false, optional = true }
time = "0.3.36"
# kanata-keyberon = "0.161.0"
# kanata-parser = "0.161.0"
Expand All @@ -68,7 +68,7 @@ open = { version = "5", optional = true }

[target.'cfg(target_os = "linux")'.dependencies]
signal-hook = "0.3.14"
inotify = { version = "0.10.0", default_features = false }
inotify = { version = "0.10.0", default-features = false }
mio = { version = "0.8.11", features = ["os-poll", "os-ext"] }
nix = { version = "0.26.1", features = ["ioctl"] }
sd-notify = "0.4.1"
Expand Down Expand Up @@ -101,7 +101,7 @@ windows-sys = { version = "0.52.0", features = [
"Wdk_System",
"Wdk_System_SystemServices",
], optional=true }
native-windows-gui = { version = "1.0.13", default_features = false}
native-windows-gui = { version = "1.0.13", default-features = false}
regex = { version = "1.10.4", optional = true }
kanata-interception = { version = "0.2.0", optional = true }
muldiv = { version = "1.0.1", optional = true }
Expand Down
9 changes: 3 additions & 6 deletions keyberon/src/chord.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,7 @@ impl<'a, T> ChordsV2<'a, T> {
}

pub(crate) fn get_action_chv2(&mut self) -> (QueuedAction<'a, T>, bool) {
match self
.active_chords
self.active_chords
.iter_mut()
.find_map(|ach| match ach.status {
Unread => {
Expand All @@ -191,10 +190,8 @@ impl<'a, T> ChordsV2<'a, T> {
Some((Some(((0, ach.coordinate), ach.delay, ach.action)), true))
}
Releasable | Released => None,
}) {
Some(v) => v,
None => (None, false),
}
})
.unwrap_or_default()
}

/// Update the times in the queue without activating any chords yet.
Expand Down
2 changes: 1 addition & 1 deletion parser/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ edition = "2021"

[dependencies]
itertools = "0.12"
log = { version = "0.4.8", default_features = false }
log = { version = "0.4.8", default-features = false }
anyhow = "1"
parking_lot = "0.12"
once_cell = "1"
Expand Down
6 changes: 3 additions & 3 deletions simulated_input/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ path = "src/sim.rs"

[dependencies]
anyhow = "1"
clap = { version = "4", features = [ "std", "derive", "help", "suggestions" ], default_features = false }
clap = { version = "4", features = [ "std", "derive", "help", "suggestions" ], default-features = false }
dirs = "5.0.1"
log = { version = "0.4.8", default_features = false }
log = { version = "0.4.8", default-features = false }
simplelog = "0.12.0"
time = "0.3.36"

kanata = { path = ".." , default_features = false }
kanata = { path = ".." , default-features = false }

[features]
default = ["simulated_output", "tcp_server"]
Expand Down
6 changes: 3 additions & 3 deletions simulated_passthru/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ crate-type = ['lib','cdylib']

[dependencies]
anyhow = "1"
log = { version = "0.4.8", default_features = false }
log = { version = "0.4.8", default-features = false }
parking_lot = "0.12"
regex = "1.10.3"

kanata = {path=".." , default_features=false}
kanata = {path=".." , default-features=false}

lazy_static = "1.4.0"

Expand All @@ -25,7 +25,7 @@ winapi = { version = "0.3.9", features = [
"timeapi",
"mmsystem",
] }
native-windows-gui = { version = "1.0.12", default_features = false }
native-windows-gui = { version = "1.0.12", default-features = false }
kanata-interception = { version = "0.2.0", optional = true }
win_dbg_logger = "0.1.0"
widestring = "1.1.0"
Expand Down
1 change: 1 addition & 0 deletions src/gui/win_nwg_ext/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ impl BitmapEx for nwg::Bitmap {
};

// Ugly hack to set the private `owned` field inside nwg::Bitmap to true
#[allow(clippy::missing_transmute_annotations)]
unsafe { std::mem::transmute(bitmap) }
}
}
Expand Down
18 changes: 10 additions & 8 deletions src/oskbd/windows/llhook.rs
Original file line number Diff line number Diff line change
Expand Up @@ -422,14 +422,16 @@ fn mouse_event(flags: u32, data: u32, dx: i32, dy: i32) {
let mut input = INPUT {
type_: INPUT_MOUSE,
u: unsafe {
mem::transmute(MOUSEINPUT {
dx,
dy,
mouseData: data,
dwFlags: flags,
time: 0,
dwExtraInfo: 0,
})
mem::transmute::<winapi::um::winuser::MOUSEINPUT, winapi::um::winuser::INPUT_u>(
MOUSEINPUT {
dx,
dy,
mouseData: data,
dwFlags: flags,
time: 0,
dwExtraInfo: 0,
},
)
},
};
unsafe { SendInput(1, &mut input as LPINPUT, mem::size_of::<INPUT>() as c_int) };
Expand Down
4 changes: 2 additions & 2 deletions tcp_protocol/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ description = "TCP protocol for kanata. This does not follow semver."
license = "LGPL-3.0-only"

[dependencies]
serde = { version = "1", features = ["alloc", "derive"], default_features = false }
serde = { version = "1", features = ["alloc", "derive"], default-features = false }
serde_derive = "1.0"
serde_json = { version = "1", features = ["alloc"], default_features = false }
serde_json = { version = "1", features = ["alloc"], default-features = false }
2 changes: 1 addition & 1 deletion wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ crate-type = [ "cdylib", "rlib" ]

[dependencies]
wasm-bindgen = "0.2.92"
kanata = { path = ".." , default_features = false, features = [ "simulated_output", "wasm" ] }
kanata = { path = ".." , default-features = false, features = [ "simulated_output", "wasm" ] }
anyhow = "1.0.81"
log = "0.4.21"
console_error_panic_hook = "0.1.7"
4 changes: 2 additions & 2 deletions windows_key_tester/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ license = "LGPL-3.0"
edition = "2021"

[target.'cfg(target_os = "windows")'.dependencies]
clap = { version = "4", features = [ "std", "derive", "help", "suggestions" ], default_features = false }
clap = { version = "4", features = [ "std", "derive", "help", "suggestions" ], default-features = false }
log = "0.4.8"
simplelog = "0.12.0"
anyhow = "1"
Expand All @@ -21,7 +21,7 @@ winapi = { version = "0.3.9", features = [
"timeapi",
"mmsystem",
] }
native-windows-gui = { version = "1.0.12", default_features = false }
native-windows-gui = { version = "1.0.12", default-features = false }
kanata-interception = { version = "0.2.0", optional = true }
kanata = { path = "..", optional = true }

Expand Down
1 change: 1 addition & 0 deletions windows_key_tester/src/windows/llhook.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ impl Drop for KeyboardHook {
}

/// Key event received by the low level keyboard hook.
#[allow(dead_code)]
#[derive(Debug, Clone, Copy)]
pub struct InputEvent {
pub code: u32,
Expand Down

0 comments on commit 9f939cd

Please sign in to comment.