mirror of
https://github.com/Noratrieb/cargo-minimize.git
synced 2026-01-15 08:55:02 +01:00
just works
This commit is contained in:
parent
dcd163aeda
commit
436546eaf5
7 changed files with 23 additions and 14 deletions
|
|
@ -57,6 +57,9 @@ impl Minimizer {
|
|||
.map(|entry| SourceFile {
|
||||
path: entry.into_path(),
|
||||
})
|
||||
.inspect(|file| {
|
||||
println!("- {}", file.path.display());
|
||||
})
|
||||
.collect();
|
||||
|
||||
Self { files, build }
|
||||
|
|
@ -94,7 +97,8 @@ impl Minimizer {
|
|||
let mut krate = syn::parse_file(change.before_content())
|
||||
.with_context(|| format!("parsing file {file_display}"))?;
|
||||
|
||||
let has_made_change = pass.process_file(&mut krate, file, &mut ProcessChecker {});
|
||||
let has_made_change =
|
||||
pass.process_file(&mut krate, file, &mut ProcessChecker {});
|
||||
|
||||
match has_made_change {
|
||||
ProcessState::Changed | ProcessState::FileInvalidated => {
|
||||
|
|
|
|||
|
|
@ -144,7 +144,6 @@ impl Processor for DeleteUnusedFunctions {
|
|||
|
||||
#[derive(Debug)]
|
||||
struct Unused {
|
||||
name: String,
|
||||
line: usize,
|
||||
column: Range<usize>,
|
||||
}
|
||||
|
|
@ -184,7 +183,6 @@ impl FindUnusedFunction {
|
|||
return None;
|
||||
}
|
||||
|
||||
let name = diag.message.split("`").nth(1)?.to_owned();
|
||||
let span = &diag.spans[0];
|
||||
|
||||
assert_eq!(
|
||||
|
|
@ -197,7 +195,6 @@ impl FindUnusedFunction {
|
|||
}
|
||||
|
||||
Some(Unused {
|
||||
name,
|
||||
line: span.line_start,
|
||||
column: (span.column_start - 1)..(span.column_end - 1),
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue