Fix clippy lints
This commit is contained in:
parent
e2605c8cee
commit
e491ff6319
2 changed files with 3 additions and 1 deletions
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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),
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue