Implement FoldMap's folds using a SumTree

This required passing a `Context` object to `Summary` and introducing a
new `SeekDimension` trait that allows comparing two dimensions and pass
an additional context object.
This commit is contained in:
Antonio Scandurra
2021-05-06 16:20:23 +02:00
parent 7fb7a6adfc
commit 901525bf77
9 changed files with 354 additions and 151 deletions
+2
View File
@@ -536,6 +536,8 @@ impl Default for EntrySummary {
}
impl sum_tree::Summary for EntrySummary {
type Context = ();
fn add_summary(&mut self, rhs: &Self) {
self.max_path = rhs.max_path.clone();
self.file_count += rhs.file_count;