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

@ -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?)");