You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In web-audio-api-rs-main/src/lib.rs, the comment "panic if the given value is not lower than or equal to zero" means panic if length >0 while the code panics if length <= 0.
/// Assert that the given value number is a valid buffer length, i.e. greater than zero////// # Panics////// This function will panic if:/// - the given value is not lower than or equal to zero///#[track_caller]#[inline(always)]pub(crate)fnassert_valid_buffer_length(length:usize){assert!(
length > 0,"NotSupportedError - Invalid length: {:?} is less than or equal to minimum bound (0)",
length,);}
In web-audio-api-rs-main/src/render/quantum.rs, the comment means panic if index > self.channels.len() which should be index >= self.channels.len()
/// Get the samples from this specific channel.////// # Panics/// Panics if the index is greater than the available number of channelspubfnchannel_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 channelspubfnchannel_data_mut(&mutself,index:usize) -> &mutAudioRenderQuantumChannel{&mutself.channels[index]}
Same problem in web-audio-api-rs-main/src/buffer.rs, the comment means panic if index > self.channels.len() which should be index >= self.channels.len().
/// Get the samples from this specific channel.////// Panics if the index is greater than the available number of channels// @note - this one is used inpub(crate)fnchannel_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 channelspub(crate)fnchannel_data_mut(&mutself,index:usize) -> &mutChannelData{&mutself.channels[index]}
So may be the comment should be changed from "Panics if the index is greater than the available number of channels" to "Panics if index >= self.channels.len()".
In web-audio-api-rs-main/src/node/panner.rs, I noticed you modify the question I mentioned before as "RangeError - maxDistance must be strictly positive" but the comment should be also modified.
////// Panics if the provided value is negative.pubfn set_max_distance(&mutself,value:f64){assert!(
value > 0.,"RangeError - maxDistance must be strictly positive");
This comment mentions code panic if value is not finite, while the code doesn't check it.
/// This function will panic if:/// - the given value is not finite and lower than zero#[track_caller]#[inline(always)]#[allow(clippy::manual_range_contains)]pub(crate)fnassert_valid_cone_outer_gain(value:f64){assert!(
value >= 0. && value <= 1.,"InvalidStateError - coneOuterGain must be in the range [0, 1]");}
The text was updated successfully, but these errors were encountered:
In web-audio-api-rs-main/src/lib.rs, the comment "panic if the given value is not lower than or equal to zero" means panic if length >0 while the code panics if length <= 0.
In web-audio-api-rs-main/src/render/quantum.rs, the comment means panic if index > self.channels.len() which should be index >= self.channels.len()
Same problem in web-audio-api-rs-main/src/buffer.rs, the comment means panic if index > self.channels.len() which should be index >= self.channels.len().
So may be the comment should be changed from "Panics if the index is greater than the available number of channels" to "Panics if index >= self.channels.len()".
In web-audio-api-rs-main/src/node/panner.rs, I noticed you modify the question I mentioned before as "RangeError - maxDistance must be strictly positive" but the comment should be also modified.
This comment mentions code panic if value is not finite, while the code doesn't check it.
The text was updated successfully, but these errors were encountered: