Skip to content

Commit a625b99

Browse files
committed
[swhkd/daemon.rs] Remove clippy warnings
Signed-off-by: Shinyzenith <aakashsensharma@gmail.com>
1 parent 19d6395 commit a625b99

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

swhkd/src/daemon.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
124124
config::MODE_ESCAPE_STATEMENT => {
125125
mode_stack.pop();
126126
}
127-
_ => commands_to_send.push_str(&format!("{} && ", cmd)),
127+
_ => commands_to_send.push_str(format!("{cmd} &&").as_str()),
128128
}
129129
}
130130
} else {
@@ -321,7 +321,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
321321

322322
let event_in_hotkeys = modes[mode_stack[mode_stack.len() - 1]].hotkeys.iter().any(|hotkey| {
323323
hotkey.keysym().code() == event.code() &&
324-
(keyboard_state.state_modifiers.len() != 0 && hotkey.modifiers().contains(&config::Modifier::Any) || keyboard_state.state_modifiers
324+
(!keyboard_state.state_modifiers.is_empty() && hotkey.modifiers().contains(&config::Modifier::Any) || keyboard_state.state_modifiers
325325
.iter()
326326
.all(|x| hotkey.modifiers().contains(x)) &&
327327
keyboard_state.state_modifiers.len() == hotkey.modifiers().len())
@@ -343,7 +343,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
343343

344344
for hotkey in possible_hotkeys {
345345
// this should check if state_modifiers and hotkey.modifiers have the same elements
346-
if (keyboard_state.state_modifiers.len() != 0 && hotkey.modifiers().contains(&config::Modifier::Any) || keyboard_state.state_modifiers.iter().all(|x| hotkey.modifiers().contains(x))
346+
if (!keyboard_state.state_modifiers.is_empty() && hotkey.modifiers().contains(&config::Modifier::Any) || keyboard_state.state_modifiers.iter().all(|x| hotkey.modifiers().contains(x))
347347
&& keyboard_state.state_modifiers.len() == hotkey.modifiers().len())
348348
&& keyboard_state.state_keysyms.contains(hotkey.keysym())
349349
{

0 commit comments

Comments
 (0)