diff --git a/src/buffer.rs b/src/buffer.rs index 0025c46d..b3624594 100644 --- a/src/buffer.rs +++ b/src/buffer.rs @@ -92,8 +92,15 @@ impl<'outer, 'inner> Iterator for Samples<'outer, 'inner> { None } } + + fn size_hint(&self) -> (usize, Option) { + let remaining = self.buffers[0].len() - self.current_sample; + (remaining, Some(remaining)) + } } +impl<'outer, 'inner> ExactSizeIterator for Samples<'outer, 'inner> {} + /// An iterator over the channel data for a sample, yielded by [Samples]. pub struct Channels<'outer, 'inner> { /// The raw output buffers. @@ -124,4 +131,11 @@ impl<'outer, 'inner> Iterator for Channels<'outer, 'inner> { None } } + + fn size_hint(&self) -> (usize, Option) { + let remaining = self.buffers0.len() - self.current_channel; + (remaining, Some(remaining)) + } } + +impl<'outer, 'inner> ExactSizeIterator for Channels<'outer, 'inner> {}