From f5b1a7fc1a9f6a227078c1f722f484d70fda5200 Mon Sep 17 00:00:00 2001 From: Otto Date: Sun, 1 Dec 2024 13:47:18 +0100 Subject: [PATCH] New clippy fixes --- src/message_port.rs | 2 +- src/render/processor.rs | 2 +- src/render/thread.rs | 4 ++-- src/worklet.rs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/message_port.rs b/src/message_port.rs index 4748a6c2..8b0e9378 100644 --- a/src/message_port.rs +++ b/src/message_port.rs @@ -10,7 +10,7 @@ use crate::events::{EventHandler, EventPayload, EventType}; /// Allowing messages to be sent from one port and listening out for them arriving at the other. pub struct MessagePort<'a>(&'a AudioContextRegistration); -impl<'a> std::fmt::Debug for MessagePort<'a> { +impl std::fmt::Debug for MessagePort<'_> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { f.debug_struct("MessagePort").finish_non_exhaustive() } diff --git a/src/render/processor.rs b/src/render/processor.rs index 2266b2a1..c1c04e64 100644 --- a/src/render/processor.rs +++ b/src/render/processor.rs @@ -207,7 +207,7 @@ pub struct AudioParamValues<'a> { nodes: &'a NodeCollection, } -impl<'a> std::fmt::Debug for AudioParamValues<'a> { +impl std::fmt::Debug for AudioParamValues<'_> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { f.debug_struct("AudioParamValues").finish_non_exhaustive() } diff --git a/src/render/thread.rs b/src/render/thread.rs index 2e7b3ce6..d0643e76 100644 --- a/src/render/thread.rs +++ b/src/render/thread.rs @@ -250,7 +250,7 @@ impl RenderThread { let mut buffer = Vec::with_capacity(self.number_of_channels); buffer.resize_with(buffer.capacity(), || Vec::with_capacity(length)); - let num_frames = (length + RENDER_QUANTUM_SIZE - 1) / RENDER_QUANTUM_SIZE; + let num_frames = length.div_ceil(RENDER_QUANTUM_SIZE); // Handle initial control messages self.handle_control_messages(); @@ -299,7 +299,7 @@ impl RenderThread { let mut buffer = Vec::with_capacity(self.number_of_channels); buffer.resize_with(buffer.capacity(), || Vec::with_capacity(length)); - let num_frames = (length + RENDER_QUANTUM_SIZE - 1) / RENDER_QUANTUM_SIZE; + let num_frames = length.div_ceil(RENDER_QUANTUM_SIZE); // Handle addition/removal of nodes/edges self.handle_control_messages(); diff --git a/src/worklet.rs b/src/worklet.rs index 0f39c9da..59df47a5 100644 --- a/src/worklet.rs +++ b/src/worklet.rs @@ -23,7 +23,7 @@ pub struct AudioParamValues<'a> { map: &'a HashMap, } -impl<'a> std::fmt::Debug for AudioParamValues<'a> { +impl std::fmt::Debug for AudioParamValues<'_> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { f.debug_struct("AudioParamValues").finish_non_exhaustive() }