Skip to content

Commit

Permalink
minor refactor deferred materializer
Browse files Browse the repository at this point in the history
Summary: simplify matching

Reviewed By: IanChilds

Differential Revision: D68562484

fbshipit-source-id: edec9b0edd4f7266f8dcd3936dbf3d52d909f079
  • Loading branch information
blackm00n authored and facebook-github-bot committed Jan 23, 2025
1 parent 92b5342 commit 9092259
Showing 1 changed file with 12 additions and 18 deletions.
30 changes: 12 additions & 18 deletions app/buck2_execute_impl/src/materializers/deferred.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1906,24 +1906,18 @@ impl<T: IoHandler> DeferredMaterializerCommandProcessor<T> {
);

// If the artifact copies from other artifacts, we must materialize them first
let deps_tasks = match entry_and_method.as_ref() {
Some((_, m)) => match m.as_ref() {
ArtifactMaterializationMethod::CasDownload { .. }
| ArtifactMaterializationMethod::HttpDownload { .. }
| ArtifactMaterializationMethod::Write { .. } => Vec::new(),
ArtifactMaterializationMethod::LocalCopy(_, copied_artifacts) => copied_artifacts
.iter()
.filter_map(|a| {
self.materialize_artifact_recurse(
MaterializeStack::Child(&stack, path),
a.src.as_ref(),
event_dispatcher.dupe(),
)
})
.collect::<Vec<_>>(),
#[cfg(test)]
ArtifactMaterializationMethod::Test => Vec::new(),
},
let method = entry_and_method.as_ref().map(|(_, m)| m.as_ref());
let deps_tasks = match method {
Some(ArtifactMaterializationMethod::LocalCopy(_, copied_artifacts)) => copied_artifacts
.iter()
.filter_map(|a| {
self.materialize_artifact_recurse(
MaterializeStack::Child(&stack, path),
a.src.as_ref(),
event_dispatcher.dupe(),
)
})
.collect::<Vec<_>>(),
_ => Vec::new(),
};

Expand Down

0 comments on commit 9092259

Please sign in to comment.