Skip to content

Commit

Permalink
Merge branch 'master' into better-benches
Browse files Browse the repository at this point in the history
  • Loading branch information
johannesvollmer authored Jan 8, 2023
2 parents 5d084f8 + 56f1d0a commit fc4ade2
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/image/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -530,8 +530,19 @@ impl Iterator for FlatSampleIterator<'_> {
}
else { None }
}

fn nth(&mut self, pos: usize) -> Option<Self::Item> {
self.channel_index += pos;
self.next()
}

fn size_hint(&self) -> (usize, Option<usize>) {
let remaining = self.layer.channel_data.list.len().saturating_sub(self.channel_index);
(remaining, Some(remaining))
}
}

impl ExactSizeIterator for FlatSampleIterator<'_> {}

impl<SampleData> AnyChannels<SampleData>{

Expand Down

0 comments on commit fc4ade2

Please sign in to comment.