various: fix collapsable-if clippy warnings

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I379d9b83a86707a59d8fdf8199a22c426a6a6964
This commit is contained in:
raf 2026-06-17 11:11:15 +03:00
commit 6413449c45
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF
2 changed files with 9 additions and 13 deletions

View file

@ -396,18 +396,16 @@ impl SqliteClipboardDb {
// Normal mode navigation commands
match (key.code, key.modifiers) {
(KeyCode::Char('q') | KeyCode::Esc, _) => actions.quit = true,
(KeyCode::Down | KeyCode::Char('j'), _) => {
(KeyCode::Down | KeyCode::Char('j'), _)
// Cap at +1 per frame for smooth scrolling
if actions.net_down < 1 {
if actions.net_down < 1 => {
actions.net_down += 1;
}
},
(KeyCode::Up | KeyCode::Char('k'), _) => {
},
(KeyCode::Up | KeyCode::Char('k'), _)
// Cap at -1 per frame for smooth scrolling
if actions.net_down > -1 {
if actions.net_down > -1 => {
actions.net_down -= 1;
}
},
},
(KeyCode::Enter, _) => actions.copy = true,
(KeyCode::Char('D'), KeyModifiers::SHIFT) => {
actions.delete = true;

View file

@ -474,13 +474,11 @@ fn handle_regular_paste(
|| types == "application/x-sh"
};
if !args.no_newline && is_text_content && !buf.ends_with(b"\n") {
if let Err(e) = out.write_all(b"\n") {
if e.kind() != io::ErrorKind::BrokenPipe {
if !args.no_newline && is_text_content && !buf.ends_with(b"\n")
&& let Err(e) = out.write_all(b"\n")
&& e.kind() != io::ErrorKind::BrokenPipe {
bail!("failed to write newline to stdout: {e}");
}
}
}
},
Err(PasteError::NoSeats) => {
bail!("no seats available (is a Wayland compositor running?)");