Skip to content

Commit

Permalink
🔧 add -s option and suppress warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
cdstanford committed Aug 22, 2024
1 parent 1e930c6 commit 9a8b2ed
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
14 changes: 10 additions & 4 deletions src/bin/scan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,13 @@ struct Args {
#[clap(short = 'd', long = "crate-download-path", default_value = ".stats_tmp")]
crate_download_path: String,

// Run in quick mode (turns off RustAnalyzer)
/// Run in quick mode (turns off RustAnalyzer)
#[clap(short, long, default_value_t = false)]
quick_mode: bool,

/// Suppress "total" lines at the bottom of the output
#[clap(short, long, default_value_t = false)]
suppress_total: bool,
}

fn main() {
Expand All @@ -42,7 +46,9 @@ fn main() {
println!("{}", effect.to_csv());
}

println!();
println!("{}", CrateStats::metadata_csv_header());
println!("{}", stats.metadata_csv());
if !args.suppress_total {
println!();
println!("{}", CrateStats::metadata_csv_header());
println!("{}", stats.metadata_csv());
}
}
4 changes: 2 additions & 2 deletions src/resolution/hacky_resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,10 +294,10 @@ impl<'a> HackyResolver<'a> {
fn save_scope_use_under(&mut self, lookup_key: &'a syn::Ident) {
// save the use scope under an identifier/lookup key
let v_new = self.scope_use_snapshot();
if log_enabled!(Level::Warn) && self.use_names.contains_key(lookup_key) {
if log_enabled!(Level::Debug) && self.use_names.contains_key(lookup_key) {
let v_old = self.use_names.get(lookup_key).unwrap();
if *v_old != v_new {
warn!(
debug!(
"Name conflict found in use scope: {:?} (old: {:?} new: {:?})",
lookup_key, v_old, v_new
);
Expand Down

0 comments on commit 9a8b2ed

Please sign in to comment.