mirror of
https://github.com/NotAShelf/stash.git
synced 2026-06-17 18:27:01 +00:00
various: fix collapsable-if clippy warnings
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I379d9b83a86707a59d8fdf8199a22c426a6a6964
This commit is contained in:
parent
8c339240c7
commit
6413449c45
2 changed files with 9 additions and 13 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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?)");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue