Skip to content
This repository has been archived by the owner on Apr 27, 2024. It is now read-only.

Commit

Permalink
cargo +nightly fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
anderejd committed Jul 17, 2018
1 parent cabeaad commit 4816987
Showing 1 changed file with 19 additions and 12 deletions.
31 changes: 19 additions & 12 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ pub fn find_unsafe(
p: &Path,
allow_partial_results: bool,
rs_files_used: &mut Option<HashMap<PathBuf, u32>>,
verbose: bool
verbose: bool,
) -> UnsafeCounter {
let counters = &mut UnsafeCounter::default();
let walker = WalkDir::new(p).into_iter();
Expand Down Expand Up @@ -462,7 +462,9 @@ fn real_main(args: Args, config: &mut Config) -> CliResult {
.map(|used| used.keys().map(|k| k.to_owned()).collect::<Vec<PathBuf>>())
.unwrap_or(Default::default());
paths.sort();
paths.iter().for_each(|p| println!("Used (sorted): {}", p.display()));
paths
.iter()
.for_each(|p| println!("Used (sorted): {}", p.display()));
}
println!();
if args.compact {
Expand Down Expand Up @@ -492,7 +494,7 @@ fn real_main(args: Args, config: &mut Config) -> CliResult {
args.all,
args.compact,
&mut rs_files_used,
verbose
verbose,
);
if let Some(rs_files_used) = rs_files_used {
rs_files_used
Expand Down Expand Up @@ -795,7 +797,7 @@ fn print_tree<'a>(
all: bool,
compact_output: bool,
rs_files_used: &mut Option<HashMap<PathBuf, u32>>,
verbose: bool
verbose: bool,
) {
let mut visited_deps = HashSet::new();
let mut levels_continue = vec![];
Expand All @@ -812,7 +814,7 @@ fn print_tree<'a>(
all,
compact_output,
rs_files_used,
verbose
verbose,
);
}

Expand All @@ -828,7 +830,7 @@ fn print_dependency<'a>(
all: bool,
compact_output: bool,
rs_files_used: &mut Option<HashMap<PathBuf, u32>>,
verbose: bool
verbose: bool,
) {
let new = all || visited_deps.insert(package.id);
let treevines = match prefix {
Expand Down Expand Up @@ -857,7 +859,12 @@ fn print_dependency<'a>(

// TODO: Find and collect unsafe stats as a separate pass over the deps
// tree before printing.
let counters = find_unsafe(package.pack.root(), allow_partial_results, rs_files_used, verbose);
let counters = find_unsafe(
package.pack.root(),
allow_partial_results,
rs_files_used,
verbose,
);
let unsafe_found = counters.has_unsafe();
let colorize = |s: String| {
if unsafe_found {
Expand Down Expand Up @@ -924,7 +931,7 @@ fn print_dependency<'a>(
all,
compact_output,
rs_files_used,
verbose
verbose,
);
print_dependency_kind(
Kind::Build,
Expand All @@ -939,7 +946,7 @@ fn print_dependency<'a>(
all,
compact_output,
rs_files_used,
verbose
verbose,
);
print_dependency_kind(
Kind::Development,
Expand All @@ -954,7 +961,7 @@ fn print_dependency<'a>(
all,
compact_output,
rs_files_used,
verbose
verbose,
);
}

Expand All @@ -971,7 +978,7 @@ fn print_dependency_kind<'a>(
all: bool,
compact_output: bool,
rs_files_used: &mut Option<HashMap<PathBuf, u32>>,
verbose: bool
verbose: bool,
) {
if deps.is_empty() {
return;
Expand Down Expand Up @@ -1014,7 +1021,7 @@ fn print_dependency_kind<'a>(
all,
compact_output,
rs_files_used,
verbose
verbose,
);
levels_continue.pop();
}
Expand Down

0 comments on commit 4816987

Please sign in to comment.