Skip to content

Commit a48584d

Browse files
committed
Fix Interpolate iterator indicating incorrect interpolation
Fix the case where leading points are interpolated, and the first non-interpolated point would be incorrectly classified as interpolated.
1 parent 287bb90 commit a48584d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

site/src/interpolate.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,12 @@ where
8181
fn next(&mut self) -> Option<Self::Item> {
8282
if let Some(mut item) = self.consumed.pop() {
8383
item.set_value(self.last_seen.unwrap());
84-
return Some((item, Interpolated::Yes));
84+
let interpolation = if self.consumed.is_empty() {
85+
Interpolated::No
86+
} else {
87+
Interpolated::Yes
88+
};
89+
return Some((item, interpolation));
8590
}
8691

8792
let mut item = self.iterator.next()?;

0 commit comments

Comments
 (0)