format and clippy

This commit is contained in:
Isaac Van Doren 2024-01-04 21:18:28 -06:00
parent 190c88e886
commit 7d3df10921
No known key found for this signature in database
GPG key ID: CFA524CD470E5B94

View file

@ -112,17 +112,19 @@ pub fn report_problems(
} }
} }
// Shadowing errors often cause cryptic type errors. To make it easy to spot the root cause, // Shadowing errors often cause cryptic type errors. To make it easy to spot the root cause,
// we print the shadowing errors last. // we print the shadowing errors last.
let problems = can_problems.remove(home).unwrap_or_default(); let problems = can_problems.remove(home).unwrap_or_default();
let (shadowing_errs, mut ordered): (Vec<Problem>, Vec<Problem>) = let (shadowing_errs, mut ordered): (Vec<Problem>, Vec<Problem>) =
problems.into_iter().partition(|p| match p { problems.into_iter().partition(|p| {
Problem::Shadowing { matches!(
original_region: _, p,
shadow: _, Problem::Shadowing {
kind: _, original_region: _,
} => true, shadow: _,
_ => false, kind: _,
}
)
}); });
ordered.extend(shadowing_errs); ordered.extend(shadowing_errs);