From d839fea748a4fa7a32ae0ebe6246449f958ff52b Mon Sep 17 00:00:00 2001 From: Mahmoud Al-Qudsi Date: Sun, 5 Mar 2023 00:54:17 -0600 Subject: [PATCH] Silence some more clippy lints bool_assert_comparison is stupid, the reason they give is "it's shorter". Well, `assert!(!foo)` is nowhere near as readable as `assert_eq!(foo, false)` because of the ! noise from the macro. Uninlined format args is a stupid lint that Rust actually walked back when they made it an official warning because you still have to use a mix of inlined and un-inlined format args (the latter of which won't complain) since only idents can be inlined. --- fish-rust/src/lib.rs | 3 +++ fish-rust/src/tests/fd_monitor.rs | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/fish-rust/src/lib.rs b/fish-rust/src/lib.rs index 6dd4b8e17..c4c97c97e 100644 --- a/fish-rust/src/lib.rs +++ b/fish-rust/src/lib.rs @@ -3,6 +3,9 @@ #![allow(non_upper_case_globals)] #![allow(clippy::needless_return)] #![allow(clippy::manual_is_ascii_check)] +#![allow(clippy::bool_assert_comparison)] +#![allow(clippy::uninlined_format_args)] +#![allow(clippy::derivable_impls)] #[macro_use] mod common; diff --git a/fish-rust/src/tests/fd_monitor.rs b/fish-rust/src/tests/fd_monitor.rs index ff0e34086..7f6a72c45 100644 --- a/fish-rust/src/tests/fd_monitor.rs +++ b/fish-rust/src/tests/fd_monitor.rs @@ -96,7 +96,9 @@ fn callback(&self, fd: &mut AutoCloseFd, reason: ItemWakeReason) { fn write42(&self) { let buf = [0u8; 42]; let mut writer = self.writer.lock().expect("Mutex poisoned!"); - writer.write_all(&buf).expect("Error writing 42 bytes to pipe!"); + writer + .write_all(&buf) + .expect("Error writing 42 bytes to pipe!"); } }