From e491ff6319f94f5bb8dd68a57ed0123588ec925f Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Fri, 4 Mar 2022 15:07:34 +0100 Subject: [PATCH] Fix clippy lints --- src/buffer.rs | 2 ++ src/param/integer.rs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/buffer.rs b/src/buffer.rs index e57519ec..49fbdeab 100644 --- a/src/buffer.rs +++ b/src/buffer.rs @@ -307,6 +307,7 @@ impl<'a> Buffer<'a> { impl<'slice, 'sample> Channels<'slice, 'sample> { /// Get the number of channels. + #[allow(clippy::len_without_is_empty)] pub fn len(&self) -> usize { unsafe { (*self.buffers).len() } } @@ -436,6 +437,7 @@ impl<'slice, 'sample> Channels<'slice, 'sample> { impl<'slice, 'sample> Block<'slice, 'sample> { /// Get the number of samples (not channels) in the block. + #[allow(clippy::len_without_is_empty)] pub fn len(&self) -> usize { self.current_block_end - self.current_block_start } diff --git a/src/param/integer.rs b/src/param/integer.rs index 83844582..a47f0cb7 100644 --- a/src/param/integer.rs +++ b/src/param/integer.rs @@ -118,7 +118,7 @@ impl Param for IntParam { let value = self.preview_plain(normalized); match (&self.value_to_string, include_unit) { (Some(f), true) => format!("{}{}", f(value), self.unit), - (Some(f), false) => format!("{}", f(value)), + (Some(f), false) => f(value), (None, true) => format!("{}{}", value, self.unit), (None, false) => format!("{}", value), }