Skip to content

Fix Code Comment Inconsistency #551

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,15 +258,15 @@ 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]
}

/// 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]
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
4 changes: 2 additions & 2 deletions src/node/panner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down Expand Up @@ -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.,
Expand Down
4 changes: 2 additions & 2 deletions src/render/quantum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,15 +228,15 @@ 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]
}

/// 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]
}
Expand Down