Fix row indexing with inclusive ranges

This commit is contained in:
Alexandru Placinta 2024-02-11 23:53:57 +01:00 committed by GitHub
parent 117719b321
commit 5c4469ffa7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -291,7 +291,7 @@ impl<T> Index<RangeToInclusive<Column>> for Row<T> {
impl<T> IndexMut<RangeToInclusive<Column>> for Row<T> {
#[inline]
fn index_mut(&mut self, index: RangeToInclusive<Column>) -> &mut [T] {
self.occ = max(self.occ, *index.end);
self.occ = max(self.occ, *index.end + 1);
&mut self.inner[..=(index.end.0)]
}
}