From 6413449c45333a64968bb338b35a00ecb05b1ed7 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Wed, 17 Jun 2026 11:11:15 +0300 Subject: [PATCH] various: fix `collapsable-if` clippy warnings Signed-off-by: NotAShelf Change-Id: I379d9b83a86707a59d8fdf8199a22c426a6a6964 --- src/commands/list.rs | 14 ++++++-------- src/multicall/wl_paste.rs | 8 +++----- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/commands/list.rs b/src/commands/list.rs index 3a0b3b9..b926537 100644 --- a/src/commands/list.rs +++ b/src/commands/list.rs @@ -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; diff --git a/src/multicall/wl_paste.rs b/src/multicall/wl_paste.rs index 5a893d6..50cd4e9 100644 --- a/src/multicall/wl_paste.rs +++ b/src/multicall/wl_paste.rs @@ -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?)");