diff --git a/src/buffer.rs b/src/buffer.rs index 60561b1d..b9b76736 100644 --- a/src/buffer.rs +++ b/src/buffer.rs @@ -258,7 +258,7 @@ impl AudioBuffer { /// Get the samples from this specific channel. /// - /// Panics if the index is greater than the available number of channels + /// Panics if the index >= self.channels.len() // @note - this one is used in pub(crate) fn channel_data(&self, index: usize) -> &ChannelData { &self.channels[index] @@ -266,7 +266,7 @@ impl AudioBuffer { /// Get the samples (mutable) from this specific channel. /// - /// Panics if the index is greater than the available number of channels + /// Panics if the index >= self.channels.len() pub(crate) fn channel_data_mut(&mut self, index: usize) -> &mut ChannelData { &mut self.channels[index] } diff --git a/src/lib.rs b/src/lib.rs index a7c97151..dbf935bf 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -195,7 +195,7 @@ pub(crate) fn assert_valid_channel_number(channel_number: usize, number_of_chann /// # Panics /// /// This function will panic if: -/// - the given value is not lower than or equal to zero +/// - the given length is less than or equal to zero /// #[track_caller] #[inline(always)] diff --git a/src/node/panner.rs b/src/node/panner.rs index 3cc7f0f5..7a19727f 100644 --- a/src/node/panner.rs +++ b/src/node/panner.rs @@ -20,7 +20,7 @@ use super::{AudioNode, AudioNodeOptions, ChannelConfig, ChannelCountMode, Channe /// # Panics /// /// This function will panic if: -/// - the given value is not finite and lower than zero +/// - the given value is greater than one and lower than zero #[track_caller] #[inline(always)] #[allow(clippy::manual_range_contains)] @@ -572,7 +572,7 @@ impl PannerNode { /// /// # Panics /// - /// Panics if the provided value is negative. + /// Panics if the provided value is not positive. pub fn set_max_distance(&mut self, value: f64) { assert!( value > 0., diff --git a/src/render/quantum.rs b/src/render/quantum.rs index fdc0e6eb..e5f6995f 100644 --- a/src/render/quantum.rs +++ b/src/render/quantum.rs @@ -228,7 +228,7 @@ impl AudioRenderQuantum { /// Get the samples from this specific channel. /// /// # Panics - /// Panics if the index is greater than the available number of channels + /// Panics if index >= self.channels.len() pub fn channel_data(&self, index: usize) -> &AudioRenderQuantumChannel { &self.channels[index] } @@ -236,7 +236,7 @@ impl AudioRenderQuantum { /// Get the samples (mutable) from this specific channel. /// /// # Panics - /// Panics if the index is greater than the available number of channels + /// Panics if index >= self.channels.len() pub fn channel_data_mut(&mut self, index: usize) -> &mut AudioRenderQuantumChannel { &mut self.channels[index] }