Add Cursor::seek_end and audit the codebase to use seek_start more

This commit is contained in:
Antonio Scandurra 2021-06-10 13:55:15 +02:00
parent f294bfdbd9
commit dc2805bb14
4 changed files with 82 additions and 76 deletions

View file

@ -49,6 +49,16 @@ where
&self.seek_dimension
}
pub fn seek_end(&self, cx: &<T::Summary as Summary>::Context) -> S {
if let Some(item_summary) = self.item_summary() {
let mut end = self.seek_start().clone();
end.add_summary(item_summary, cx);
end
} else {
self.seek_start().clone()
}
}
pub fn start(&self) -> &U {
&self.sum_dimension
}