Touch up controller logic to handle nested items well.

The test in the previous commit now passes
This commit is contained in:
moxian 2025-03-30 15:27:01 -07:00
parent fdfa1bed09
commit f38632d83e
3 changed files with 77 additions and 27 deletions

View file

@ -187,6 +187,7 @@ impl Minimizer {
// The logic for bisecting down lives in PassController.
let mut checker = PassController::new(self.options.clone());
let mut initial_pass = true;
loop {
let mut change = file.try_change(changes)?;
let (_, krate) = change.before_content();
@ -213,14 +214,17 @@ impl Minimizer {
}
}
ProcessState::NoChange => {
if self.options.no_color {
info!("{file:?}: After {}: no changes", pass.name());
} else {
info!("{file:?}: After {}: {}", pass.name(), "no changes".yellow());
if !initial_pass {
if self.options.no_color {
info!("{file:?}: After {}: no changes", pass.name());
} else {
info!("{file:?}: After {}: {}", pass.name(), "no changes".yellow());
}
}
checker.no_change();
}
}
initial_pass = false;
if self.cancel.load(Ordering::SeqCst) {
info!("Exiting early.");