Skip to content

Commit

Permalink
refactor(cargo-tree): simplify arg-parsing logic
Browse files Browse the repository at this point in the history
Co-authored-by: Eric Huss <[email protected]>
  • Loading branch information
weihanglo and ehuss committed Jun 2, 2021
1 parent 681c194 commit c685c13
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/bin/cargo/commands/tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<Vec<_>>();
specs.sort_unstable();
specs.dedup();
specs
},
);
let pkgs_to_prune = args._values_of("prune");

let packages = args.packages_from_flags()?;
let mut invert = args
Expand Down

0 comments on commit c685c13

Please sign in to comment.