Generalize Dimension<FragmentSummary> for tuples
This commit is contained in:
@@ -2258,17 +2258,14 @@ impl<'a> sum_tree::SeekDimension<'a, FragmentSummary> for VersionedOffset {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> sum_tree::Dimension<'a, FragmentSummary> for (VersionedOffset, usize) {
|
impl<'a, T, U> sum_tree::Dimension<'a, FragmentSummary> for (T, U)
|
||||||
|
where
|
||||||
|
T: sum_tree::Dimension<'a, FragmentSummary>,
|
||||||
|
U: sum_tree::Dimension<'a, FragmentSummary>,
|
||||||
|
{
|
||||||
fn add_summary(&mut self, summary: &'a FragmentSummary, cx: &Option<time::Global>) {
|
fn add_summary(&mut self, summary: &'a FragmentSummary, cx: &Option<time::Global>) {
|
||||||
self.0.add_summary(summary, cx);
|
self.0.add_summary(summary, cx);
|
||||||
self.1 += summary.text.visible;
|
self.1.add_summary(summary, cx);
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<'a> sum_tree::Dimension<'a, FragmentSummary> for (VersionedOffset, FullOffset) {
|
|
||||||
fn add_summary(&mut self, summary: &'a FragmentSummary, cx: &Option<time::Global>) {
|
|
||||||
self.0.add_summary(summary, cx);
|
|
||||||
self.1 .0 += summary.text.visible + summary.text.deleted;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user