mirror of
https://github.com/Noratrieb/cargo-minimize.git
synced 2026-01-14 16:35:01 +01:00
Minor reaper opti: don't do rustfix with no suggestions
This commit is contained in:
parent
b4e587506f
commit
78a3cec9d6
1 changed files with 8 additions and 0 deletions
|
|
@ -75,9 +75,17 @@ impl Minimizer {
|
|||
.copied()
|
||||
.cloned()
|
||||
.collect::<Vec<_>>();
|
||||
if desired_suggestions.is_empty() {
|
||||
continue;
|
||||
}
|
||||
|
||||
let result =
|
||||
rustfix::apply_suggestions(change.before_content().0, &desired_suggestions)?;
|
||||
anyhow::ensure!(
|
||||
result != change.before_content().0,
|
||||
"Suggestions 'applied' but no changes made??"
|
||||
);
|
||||
|
||||
let result = syn::parse_file(&result).context("parsing file after rustfix")?;
|
||||
change.write(result)?;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue