From c685c139768091d7c972d1e16045c14532da01e8 Mon Sep 17 00:00:00 2001 From: Weihang Lo Date: Thu, 3 Jun 2021 07:01:45 +0800 Subject: [PATCH] refactor(cargo-tree): simplify arg-parsing logic Co-authored-by: Eric Huss --- src/bin/cargo/commands/tree.rs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/bin/cargo/commands/tree.rs b/src/bin/cargo/commands/tree.rs index 07b4b23afc2..6b996d66fa2 100644 --- a/src/bin/cargo/commands/tree.rs +++ b/src/bin/cargo/commands/tree.rs @@ -157,15 +157,7 @@ pub fn exec(config: &mut Config, args: &ArgMatches<'_>) -> CliResult { let (edge_kinds, no_proc_macro) = parse_edge_kinds(config, args)?; let graph_features = edge_kinds.contains(&EdgeKind::Feature); - let pkgs_to_prune = args.values_of("prune").map_or_else( - || Vec::new(), - |ps| { - let mut specs = ps.map(|p| p.to_string()).collect::>(); - specs.sort_unstable(); - specs.dedup(); - specs - }, - ); + let pkgs_to_prune = args._values_of("prune"); let packages = args.packages_from_flags()?; let mut invert = args