1
0
Fork 0
mirror of https://github.com/alacritty/alacritty.git synced 2024-11-18 13:55:23 -05:00

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> { impl<T> IndexMut<RangeToInclusive<Column>> for Row<T> {
#[inline] #[inline]
fn index_mut(&mut self, index: RangeToInclusive<Column>) -> &mut [T] { 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)] &mut self.inner[..=(index.end.0)]
} }
} }