Skip to content

Commit

Permalink
local_working_copy: remove unneeded boxing of diff stream
Browse files Browse the repository at this point in the history
  • Loading branch information
yuja committed Dec 3, 2024
1 parent 05fc855 commit 8f55680
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions lib/src/local_working_copy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1545,20 +1545,18 @@ impl TreeState {
};
let mut changed_file_states = Vec::new();
let mut deleted_files = HashSet::new();
let mut diff_stream = Box::pin(
old_tree
.diff_stream(new_tree, matcher)
.map(|TreeDiffEntry { path, values }| async {
match values {
Ok((before, after)) => {
let result = materialize_tree_value(&self.store, &path, after).await;
(path, result.map(|value| (before, value)))
}
Err(err) => (path, Err(err)),
let mut diff_stream = old_tree
.diff_stream(new_tree, matcher)
.map(|TreeDiffEntry { path, values }| async {
match values {
Ok((before, after)) => {
let result = materialize_tree_value(&self.store, &path, after).await;
(path, result.map(|value| (before, value)))
}
})
.buffered(self.store.concurrency().max(1)),
);
Err(err) => (path, Err(err)),
}
})
.buffered(self.store.concurrency().max(1));
while let Some((path, data)) = diff_stream.next().await {
let (before, after) = data?;
if after.is_absent() {
Expand Down

0 comments on commit 8f55680

Please sign in to comment.