From 8f5568078787160acfcda78ebbc8c0369a39e0e0 Mon Sep 17 00:00:00 2001 From: Yuya Nishihara <yuya@tcha.org> Date: Mon, 2 Dec 2024 15:31:59 +0900 Subject: [PATCH] local_working_copy: remove unneeded boxing of diff stream --- lib/src/local_working_copy.rs | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/lib/src/local_working_copy.rs b/lib/src/local_working_copy.rs index 3a2407369..4ea5e1ced 100644 --- a/lib/src/local_working_copy.rs +++ b/lib/src/local_working_copy.rs @@ -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() {