diff options
Diffstat (limited to 'src/lerp/poly/iter.rs')
-rw-r--r-- | src/lerp/poly/iter.rs | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/src/lerp/poly/iter.rs b/src/lerp/poly/iter.rs deleted file mode 100644 index 90cc4b5..0000000 --- a/src/lerp/poly/iter.rs +++ /dev/null @@ -1,38 +0,0 @@ -use std::cmp; -use std::iter::{Take, Zip}; - -pub struct Iter { - index: usize, - data: Vec<f32>, - degree: usize, -} - -impl Iter { - pub fn new(data: Vec<f32>, degree: usize) -> Iter { - Iter { - index: 0, - data, - degree, - } - } - - pub fn zip(self, other: Self) -> Zip<Take<Iter>, Take<Iter>> { - let deg = cmp::max(self.degree, other.degree) + 1; - let a = self.take(deg); - let b = other.take(deg); - a.zip(b) - } -} - -impl Iterator for Iter { - type Item = f32; - - fn next(&mut self) -> Option<f32> { - self.index += 1; - if self.index <= self.data.len() { - Some(self.data[self.index - 1]) - } else { - Some(0.0) - } - } -} |