1
0
Fork 0

Fix clippy lints

This commit is contained in:
Robbert van der Helm 2022-03-04 15:07:34 +01:00
parent e2605c8cee
commit e491ff6319
2 changed files with 3 additions and 1 deletions

View file

@ -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
}

View file

@ -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),
}