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.
let problems = can_problems.remove(home).unwrap_or_default();
let (shadowing_errs, mut ordered): (Vec<Problem>, Vec<Problem>) =
problems.into_iter().partition(|p| match p {
Problem::Shadowing {
original_region: _,
shadow: _,
kind: _,
} => true,
_ => false,
problems.into_iter().partition(|p| {
matches!(
p,
Problem::Shadowing {
original_region: _,
shadow: _,
kind: _,
}
)
});
ordered.extend(shadowing_errs);