merged_tree: avoid two unnecessary clones

This commit is contained in:
Martin von Zweigbergk 2024-11-27 15:07:00 -08:00 committed by Martin von Zweigbergk
parent bf17067861
commit b9e93923a9

View file

@ -211,7 +211,7 @@ impl MergedTree {
}
_ => {
let subdir = self.dir().join(name);
Ok(Tree::empty(self.store().clone(), subdir.clone()))
Ok(Tree::empty(self.store().clone(), subdir))
}
})?;
Ok(Some(MergedTree { trees }))
@ -961,7 +961,7 @@ impl<'matcher> TreeDiffStreamImpl<'matcher> {
.await?;
builder.build()
} else {
Merge::resolved(Tree::empty(store, dir.clone()))
Merge::resolved(Tree::empty(store, dir))
};
Ok(MergedTree { trees })
}