Skip to content

Commit 681c194

Browse files
weihangloehuss
andauthored
refactor(cargo-tree): remove premature micro optimization
Co-authored-by: Eric Huss <eric@huss.org>
1 parent 07c40a7 commit 681c194

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/cargo/ops/tree/mod.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -412,15 +412,11 @@ fn print_dependencies<'a>(
412412
})
413413
.filter(|dep| {
414414
// Filter out packages to prune.
415-
if !pkgs_to_prune.is_empty() {
416-
match graph.node(**dep) {
417-
Node::Package { package_id, .. } => {
418-
!pkgs_to_prune.iter().any(|spec| spec.matches(*package_id))
419-
}
420-
_ => true,
415+
match graph.node(**dep) {
416+
Node::Package { package_id, .. } => {
417+
!pkgs_to_prune.iter().any(|spec| spec.matches(*package_id))
421418
}
422-
} else {
423-
true
419+
_ => true,
424420
}
425421
})
426422
.peekable();

0 commit comments

Comments
 (0)