add unreachable pattern warnings to RowIndexLookupHelper implementations

This commit is contained in:
Palash Tyagi 2025-04-21 00:47:09 +01:00
parent 9b0472b750
commit 6d371a50e3

View File

@ -602,6 +602,7 @@ impl<T: Clone + PartialEq> RowIndexLookupHelper<usize> for Frame<T> {
panic!("Frame index: incompatible key type usize for Date index") panic!("Frame index: incompatible key type usize for Date index")
} }
// Ensure state consistency // Ensure state consistency
#[allow(unreachable_patterns)]
(RowIndex::Int(_), RowIndexLookup::None) (RowIndex::Int(_), RowIndexLookup::None)
| (RowIndex::Int(_), RowIndexLookup::Date(_)) | (RowIndex::Int(_), RowIndexLookup::Date(_))
| (RowIndex::Date(_), RowIndexLookup::Int(_)) | (RowIndex::Date(_), RowIndexLookup::Int(_))
@ -634,6 +635,7 @@ impl<T: Clone + PartialEq> RowIndexLookupHelper<NaiveDate> for Frame<T> {
panic!("Frame index: incompatible key type NaiveDate for Int or Range index") panic!("Frame index: incompatible key type NaiveDate for Int or Range index")
} }
// Ensure state consistency // Ensure state consistency
#[allow(unreachable_patterns)]
(RowIndex::Date(_), RowIndexLookup::None) (RowIndex::Date(_), RowIndexLookup::None)
| (RowIndex::Date(_), RowIndexLookup::Int(_)) | (RowIndex::Date(_), RowIndexLookup::Int(_))
| (RowIndex::Int(_), RowIndexLookup::Date(_)) | (RowIndex::Int(_), RowIndexLookup::Date(_))