use exhaustive pattern match to prevent future bugs

This commit is contained in:
Simon Vandel Sillesen 2020-12-28 23:19:35 +01:00
parent 3d5a1e330f
commit 0010fc8fec

View File

@ -301,9 +301,18 @@ struct OptimizationList<'tcx> {
impl<'tcx> OptimizationList<'tcx> {
fn is_empty(&self) -> bool {
self.and_stars.is_empty()
&& self.arrays_lengths.is_empty()
&& self.unneeded_equality_comparison.is_empty()
&& self.unneeded_deref.is_empty()
match self {
OptimizationList {
and_stars,
arrays_lengths,
unneeded_equality_comparison,
unneeded_deref,
} => {
and_stars.is_empty()
&& arrays_lengths.is_empty()
&& unneeded_equality_comparison.is_empty()
&& unneeded_deref.is_empty()
}
}
}
}