Make the definition of buffer length more explicit
This is the standard definition, but apparently it's still confusing. Resolves #47.
This commit is contained in:
parent
78c84b7596
commit
46752fc7f0
|
@ -28,7 +28,7 @@ pub struct Buffer<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> Buffer<'a> {
|
impl<'a> Buffer<'a> {
|
||||||
/// Returns the number of samples in this buffer.
|
/// Returns the number of samples per channel in this buffer.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn len(&self) -> usize {
|
pub fn len(&self) -> usize {
|
||||||
if self.output_slices.is_empty() {
|
if self.output_slices.is_empty() {
|
||||||
|
|
|
@ -124,7 +124,7 @@ impl ExactSizeIterator for BlocksIter<'_, '_> {}
|
||||||
impl ExactSizeIterator for BlockChannelsIter<'_, '_> {}
|
impl ExactSizeIterator for BlockChannelsIter<'_, '_> {}
|
||||||
|
|
||||||
impl<'slice, 'sample> Block<'slice, 'sample> {
|
impl<'slice, 'sample> Block<'slice, 'sample> {
|
||||||
/// Get the number of samples (not channels) in the block.
|
/// Get the number of samples per channel in the block.
|
||||||
#[allow(clippy::len_without_is_empty)]
|
#[allow(clippy::len_without_is_empty)]
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn len(&self) -> usize {
|
pub fn len(&self) -> usize {
|
||||||
|
|
Loading…
Reference in a new issue